clangd / vscode-clangd

Visual Studio Code extension for clangd
https://marketplace.visualstudio.com/items?itemName=llvm-vs-code-extensions.vscode-clangd
MIT License
594 stars 97 forks source link

Use too many memory when open miniaudio.h #562

Closed KAIYOHUGO closed 7 months ago

KAIYOHUGO commented 7 months ago

When I open miniaudio.h file in vscode, memory usage grow to 30 GB therefore cause OOM.

Screencast from 12-07-2023 09:15:15 PM.webm

Logs

``` I[21:18:11.481] clangd version 17.0.3 (https://github.com/llvm/llvm-project 888437e1b60011b8a375dd30928ec925b448da57) I[21:19:28.686] ASTWorker building file /home/hugo/.cache/bazel/_bazel_hugo/3c46111f10330df82377c253f256047b/execroot/__main__/bazel-out/k8-fastbuild/bin/_virtual_includes/miniaudio/miniaudio.h version 1 with command [/home/hugo/Desktop/Vscode/hell_pac_man] /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -MD -MF bazel-out/k8-fastbuild/bin/_objs/main/global.pic.d -frandom-seed=bazel-out/k8-fastbuild/bin/_objs/main/global.pic.o -fPIC "-DBAZEL_CURRENT_REPOSITORY=\"\"" -iquote . -iquote bazel-out/k8-fastbuild/bin -iquote external/bazel_tools -iquote bazel-out/k8-fastbuild/bin/external/bazel_tools -Ibazel-out/k8-fastbuild/bin/_virtual_includes/miniaudio -Ibazel-out/k8-fastbuild/bin/evangel/_virtual_includes/evangel -Wno-builtin-macro-redefined "-D__DATE__=\"redacted\"" "-D__TIMESTAMP__=\"redacted\"" "-D__TIME__=\"redacted\"" -c -x c-header -isystem /usr/lib/gcc/x86_64-linux-gnu/11/include -isystem /usr/local/include -isystem /usr/include/x86_64-linux-gnu -isystem /usr/include --target=x86_64-linux-gnu -resource-dir=/home/hugo/.config/Code/User/globalStorage/llvm-vs-code-extensions.vscode-clangd/install/17.0.3/clangd_17.0.3/lib/clang/17 -- /home/hugo/.cache/bazel/_bazel_hugo/3c46111f10330df82377c253f256047b/execroot/__main__/bazel-out/k8-fastbuild/bin/_virtual_includes/miniaudio/miniaudio.h I[21:19:28.687] --> textDocument/clangd.fileStatus I[21:19:28.700] Built preamble of size 266880 for file /home/hugo/.cache/bazel/_bazel_hugo/3c46111f10330df82377c253f256047b/execroot/__main__/bazel-out/k8-fastbuild/bin/_virtual_includes/miniaudio/miniaudio.h version 1 in 0.01 seconds I[21:19:28.700] --> workspace/semanticTokens/refresh(2) I[21:19:28.721] <-- reply(2) I[21:19:29.036] <-- textDocument/semanticTokens/full(32) I[21:19:29.036] <-- textDocument/documentLink(33) I[21:19:29.039] <-- textDocument/inlayHint(34) I[21:19:29.039] <-- textDocument/codeAction(35) I[21:19:29.039] <-- $/cancelRequest I[21:19:29.039] <-- textDocument/foldingRange(36) I[21:19:29.988] <-- textDocument/codeAction(37) I[21:19:29.988] <-- $/cancelRequest I[21:19:33.849] <-- textDocument/hover(38) I[21:19:34.070] <-- $/cancelRequest I[21:19:45.801] <-- $/cancelRequest I[21:19:45.802] <-- $/cancelRequest I[21:19:45.805] <-- $/cancelRequest I[21:19:45.805] <-- $/cancelRequest I[21:19:45.806] <-- $/cancelRequest I[21:19:45.816] <-- $/cancelRequest I[21:19:45.816] <-- textDocument/didClose I[21:19:45.817] --> textDocument/publishDiagnostics I[21:19:45.827] <-- textDocument/codeAction(39) I[21:19:45.827] --> reply:textDocument/codeAction(39) 0 ms I[21:19:45.827] --> textDocument/clangd.fileStatus I[21:19:45.849] <-- textDocument/documentLink(40) I[21:19:45.849] --> reply:textDocument/documentLink(40) 0 ms I[21:19:45.849] --> textDocument/clangd.fileStatus I[21:19:45.904] <-- textDocument/inlayHint(41) I[21:19:45.905] --> reply:textDocument/inlayHint(41) 0 ms I[21:19:45.905] --> textDocument/clangd.fileStatus I[21:19:46.082] <-- textDocument/codeAction(42) I[21:19:46.082] --> reply:textDocument/codeAction(42) 0 ms I[21:19:46.082] --> textDocument/clangd.fileStatus I[21:19:46.124] <-- textDocument/foldingRange(43) I[21:19:46.125] --> reply:textDocument/foldingRange(43) 0 ms I[21:19:46.268] <-- textDocument/semanticTokens/full/delta(44) I[21:19:46.268] --> reply:textDocument/semanticTokens/full/delta(44) 0 ms I[21:19:46.268] --> textDocument/clangd.fileStatus E[21:19:56.846] Transport error: Got signal, shutting down I[21:19:56.846] LSP finished, exiting with status 1 ```

System information Clangd version (from the log, or clangd --version): clangd version 17.0.3 clangd extension version: 0.1.24/0.1.25 Operating system: Pop-os

HighCommander4 commented 7 months ago

Duplicate of https://github.com/llvm/llvm-project/issues/60151