Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory Problem #1256

Closed
Ptilopsisw opened this issue Aug 18, 2022 · 1 comment
Closed

Memory Problem #1256

Ptilopsisw opened this issue Aug 18, 2022 · 1 comment

Comments

@Ptilopsisw
Copy link

Sometimes(such as create a big array of pair<int,int>), the clangd will cost lots of memory (related to the size of array), even cause my computer crash. The following image is the result when I modify the sample program(just deleted the ';' of line 3).

image

sample program:

#include <utility>
using namespace std;
pair<int,int> a[11451400];
int main() {}

Logs

I[18:31:09.749] <-- textDocument/didChange
I[18:31:09.750] --> textDocument/clangd.fileStatus
I[18:31:09.992] <-- textDocument/codeAction(249)
I[18:31:09.995] Failed to find compilation database for d:\Program Files\VSCode\Code\problems\incompleted\test.cpp
I[18:31:09.996] ASTWorker building file d:\Program Files\VSCode\Code\problems\incompleted\test.cpp version 123 with command clangd fallback
[d:\Program Files\VSCode\Code\problems\incompleted]
"D:\\Program Files\\LLVM\\bin\\clang" --target=x86_64-pc-mingw64 "-resource-dir=D:\\Program Files\\LLVM\\lib\\clang\\14.0.6" -- "d:\\Program Files\\VSCode\\Code\\problems\\incompleted\\test.cpp"
I[18:31:09.998] --> textDocument/clangd.fileStatus
I[18:31:10.297] <-- textDocument/didSave
I[18:31:10.297] File version went from 123 to 123
I[18:31:10.911] <-- textDocument/documentLink(250)
I[18:31:10.988] <-- clangd/inlayHints(251)
I[18:31:11.158] <-- textDocument/documentSymbol(252)
I[18:31:11.158] <-- textDocument/semanticTokens/full/delta(253)
I[18:31:12.095] --> reply:textDocument/codeAction(249) 2103 ms
I[18:31:12.095] Skipping rebuild of the AST for d:\Program Files\VSCode\Code\problems\incompleted\test.cpp, inputs are the same.
I[18:31:12.095] --> textDocument/publishDiagnostics
I[18:31:12.095] Failed to find compilation database for d:\Program Files\VSCode\Code\problems\incompleted\test.cpp
I[18:31:12.095] ASTWorker building file d:\Program Files\VSCode\Code\problems\incompleted\test.cpp version 123 with command clangd fallback
[d:\Program Files\VSCode\Code\problems\incompleted]
"D:\\Program Files\\LLVM\\bin\\clang" --target=x86_64-pc-mingw64 "-resource-dir=D:\\Program Files\\LLVM\\lib\\clang\\14.0.6" -- "d:\\Program Files\\VSCode\\Code\\problems\\incompleted\\test.cpp"
I[18:31:12.097] --> reply:textDocument/documentLink(250) 1186 ms
I[18:31:12.097] --> textDocument/clangd.fileStatus
I[18:31:12.097] --> textDocument/clangd.fileStatus
I[18:31:12.097] --> reply:clangd/inlayHints(251) 1108 ms
I[18:31:12.097] --> textDocument/clangd.fileStatus
I[18:31:12.097] --> reply:textDocument/documentSymbol(252) 938 ms
I[18:31:12.097] --> textDocument/clangd.fileStatus
I[18:31:12.097] --> reply:textDocument/semanticTokens/full/delta(253) 938 ms
I[18:31:12.097] --> textDocument/clangd.fileStatus
I[18:31:12.099] --> textDocument/clangd.fileStatus
I[18:31:12.099] --> textDocument/clangd.fileStatus
I[18:31:12.356] <-- textDocument/codeAction(254)
I[18:31:12.357] --> reply:textDocument/codeAction(254) 0 ms
I[18:31:12.357] --> textDocument/clangd.fileStatus
I[18:31:12.979] <-- clangd/inlayHints(255)
I[18:31:12.979] --> reply:clangd/inlayHints(255) 0 ms
I[18:31:12.979] --> textDocument/clangd.fileStatus
I[18:31:14.679] <-- clangd/inlayHints(256)
I[18:31:14.680] --> reply:clangd/inlayHints(256) 0 ms
I[18:31:14.680] --> textDocument/clangd.fileStatus

System information

Output of clangd --version:

clangd version 14.0.6
Features: windows
Platform: x86_64-pc-windows-msvc

Editor/LSP plugin:
Microsoft VS Code(version: 1.70.2)
Operating system:
Windows 11

@HighCommander4
Copy link

Dupe of #967

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants