-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
cpptools-srv using too much memory #13205
Comments
The settings are behaving as expected -- they don't limit the memory usage of a single cpptools-srv process. When you run the C/C++: Log Diagnostics command after opening a source file -- what memory usage is reported per TU? Over 15 GB? If so, that seems like it might be a bug. Your logging indicates no active files have been started. The cpptools-srv process only has memory for the current TU (source file and headers), so having a "large code base" should not make a difference. |
@jkriegshauser Also, your repro steps don't indicate that you have opened any files? No cpptools-srv process should launch if you don't open any files. |
Oh, I didn't realize it was per TU. I opened one VSCode instance with two source windows open. I have several source files open in the left source window and only one in the right source window. Active, the left source file is a .cpp file with 10,978 lines and in the right, a .cpp file with 1,028 lines. I have 3 cpptools-srv.exe processes running each consuming nearly 15 GB of RAM each: Though every time I do
|
@jkriegshauser Those might be dangling processes. Can you kill them? Does your C/C++ logging with C_Cpp.loggingLevel set to "Debug" indicate the IntelliSense process is shutting down or crashing? |
I had 13 cpptools-srv processes running, the most using ~26 GB RAM. I killed them all with
|
@jkriegshauser Are the crash logging from your killing the processes or from the processes actually crashing? If it's an actual crash you could potentially get a crash call stack via attaching a debugger before it crashes (https://github.com/microsoft/vscode-cpptools/wiki/Attaching-debugger-to-cpptools-or-cpptools%E2%80%90srv). It sounds like our IntelliSense parser may be hitting some bug while processing your TU. If it's using CPU while memory is increasing, attaching a debugger and hitting a breakpoint might show what processing is causing the issue if it's stuck in some loop that is allocating memory. |
I think those were from me killing the process. I have some huge memory processes: I used procdump to get mini-dumps of them and the biggest ones have threads doing this:
Unfortunately the symbols are minimal so I don't see any local variables or anything. But it definitely looks like there's some recursion happening. Would be nice to know what macro is kicking it off |
@jkriegshauser I've sent an email to the team involved. Are you able to reduce the TU to locate the macro that is triggering the excessive/infinite recursion? |
@sean-mcmanus not easily. I'm not even sure which file it's parsing. I looked at strings in the minidump that I gathered and didn't see any |
Environment
Bug Summary and Steps to Reproduce
Bug Summary:
On a very large C++ codebase, cpptools-srv.exe will consume memory, starving out the rest of the system:
I have C_Cpp: Max Memory set, but it does not appear to be used:
Steps to reproduce:
Expected behavior:
Configuration and Logs
Other Extensions
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: