-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 too many zombie processes causing laptop to crash #12694
Comments
@jacob-02 500 MB of RAM usage by cpptools-srv is expected behavior. If your laptop is crashing due to that, it could be an issue with your operation system or hardware. How much memory does your machine have? Does the issue repro with 1.21.6? |
@sean-mcmanus Firstly thank you for your response. When there is only one process of cpptools-srv running it's fine. But once I perform any action these zombie processes with each using 500 MB adding upto 2-3 GB of my RAM and the more actions I perform the more number of these processes get created. Also I have 16 GB of RAM. And I didn't get what you mean by 1.21.6? Is that a vscode version? |
@jacob-02 Why do you say they are "zombie" processes? Are they in a zombie state? When do they get into that state? It sounds like the zombie processes are causing too much RAM to be used? 1.21.6 is the non-prerelease version of the C/C++ extension. |
@sean-mcmanus I assume them to be zombie processes since they don't die. I try to force kill them but even more processes get created on trying to do that. As I have shared screenshots before and reiterated in the previous comment, on performing an action using vscode for example doing a search and replace in a workspace. Yes the same issue is there while using 1.21.6. And yes the zombie processes are causing too much RAM to be used. |
@jacob-02 We spawn a cpptools-srv process for every file that is opened. Can you confirm that if you have just one C/C++ file open and don't do a find all references (rename or call hierarchy, which also spawn more cpptools-srv) that only 1 cpptools-srv process is active? Do the cpptools-srv processes use CPU, such as if you paste in a bunch of code into a file? If so, then they're not zombie processes but active processes. If you do a find/replace on many files, we will spawn a cpptools-srv process for every file that is opened. You could try setting/lowering the C_Cpp.maxCachedProcesses, C_Cpp.maxMemory (and other related "max" settings) to try to use less resources. Using 3 GB on a 16 GB machine isn't expected to crash a machine. Although, I do remember seeing this happen using our C/C++ extension a long time ago on an older Ubuntu running Raspberry Pi (it seemed to me like a bug with the OS or hardware). |
@jacob-02 But I seem to remember the C_Cpp.max* settings may not be applied if the cpptools-srv processes are all spawned in response to a bunch of file open requests at once (possibly "by design" although maybe we could do something extra to improve the situation). We have some previously opened similar issues like #9798 and #11014 . |
@jacob-02 When I do a find/replace, I don't get the editors activated and so I get no cpptools-srv processes started -- do you have some VS Code setting that keeps the editted/replaced documents open? Changing that setting could resolve the issue for you. |
@sean-mcmanus If there is only one file open and I don't perform any actions then only one cpptools-srv is created. Also 3GB is only cpptools-srv. I have other applications open too for the task. Regarding a setting that keeps edited/replaced documents open, the files don't get opened when I perform find/replace but multiple cpptools-srv are created. Also sometimes 2 code processes also get started. I can try to reduce the C_Cpp.maxCachedProcesses, C_Cpp.maxMemory (and other related "max" settings) and see if that will reduce the problem. |
@jacob-02 I don't repro that. When I find/replace it doesn't create any extra cpptools-srv. I see clang-tidy get spawned if My logging with C_Cpp.loggingLevel set to "Debug" shows the follow messages: textDocument/didOpen and not the messages below which occur for cpptools-srv process creation: cpptools/didChangeVisibleTextEditors How does your logging differ? Also, normally an OS/hardware should be able to handle 3 GB out of 16 GB of memory usage from processes without crashing even with other apps using memory. |
Environment
Bug Summary and Steps to Reproduce
Bug Summary:
On performing any form of action like replacing all the words with another word using vscode multiple cpptools-srv processes are created with use close to 0.5 GB of RAM each causing the laptop to crash. The CPU utilisation also goes up.
Steps to reproduce:
Debugger Configurations
Debugger Logs
Other Extensions
No response
Additional Information
Before
After
The text was updated successfully, but these errors were encountered: