Open danielrparks opened 1 year ago
@llvm/issue-subscribers-clang-format
@llvm/issue-subscribers-clangd
This is affecting me too, and clangd is consuming Gigabytes even for the full version of windows.h and some other libraries I have included. Anything to help would be greatly appreciated!
This is affecting me too, and clangd is consuming Gigabytes even for the full version of windows.h and some other libraries I have included. Anything to help would be greatly appreciated!
This was fixed for clangd in version 19 (not yet released but pre-release builds can be found here) in https://github.com/llvm/llvm-project/pull/84133.
(Adjusted issue title to reflect that this has been resolved for clangd, at least in the case where you're just opening / reading / navigating a file. clang-format is still affected, and clangd is also still affected if you try to actually format an affected header file.)
I have a file blis.h which causes the guessLanguage() function to continuously consume memory, possibly indefinitely. My friend @bagel897 , who has more ram than I do, observed that it consumed 25GB before she ran out.
I have clang 15.0.7 on Arch Linux.
This affects clangd when editing the problem file as well as clang-format when formatting it. clangd is able to index the file as long as it is not opened directly in the editor, and clang is able to compile it without problems.
I believe that guessLanguage() is to blame for the issue because if I change the file extension from
.h
to.hpp
, clang-format and clangd work correctly with the file.Here is a stack trace from a clangd process experiencing the issue: