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

Add setting (and/or auto-heuristic) to limit the maximum number of IntelliSense processes to spawn #4811

Closed
sean-mcmanus opened this issue Jan 3, 2020 · 6 comments
Assignees
Labels
Feature Request fixed Check the Milestone for the release in which the fix is or will be available. Language Service performance

Comments

@sean-mcmanus
Copy link
Contributor

Based on a user comment in #3220 for 12 IntelliSense processes using >600 MB each (or more?) on a machine with 8 GB RAM.

Right now, our heuristic uses core count and not total available memory.

#4036 is tracking the Find All References case.

#4038 (Find All References) caching could be added more easily if this were fixed.

@joaquin-herrero
Copy link

joaquin-herrero commented Mar 19, 2020

Not sure if it is 100% related with the limit of spawn processes but here I have a machine with 12 cores and 12GB of RAM running Debian 9 and VSCode 1.43.

I have 23 processes of cpptools eating all my RAM so I need to reboot the machine again and again.

Te two things I can do are:
Set Intelli Sense Engine to tag parser seems to stop cpptools processes to eat all the memory.
Set the memory system limits to avoid the system hang up, but this makes me unable to use cpp features on VSCode.

@sean-mcmanus
Copy link
Contributor Author

@joaquin-herrero What version of our C/C++ extension are you using? I assume 0.27.0-insiders3? Are you using multi-root? Are you using multiple VS Code instances? Do you mean 23 cpptools processes or 23 cpptools-srv processes (or the old-named Microsoft.VSCode.Cpp proceses). Only 1 cpptools process is expected per VS Code instance. Having 23 cpptools-srv processes open is not expected unless you have 12 C++ files open and then run a Find All References operation. If you close VS Code do the processes go away (i.e. are there any dangling processes)? If you close files you aren't using, the cpptools-srv processes should go away (there's a few second delay).

Setting the IntelliSenseEngine to "Tag Parser" disables a lot of our functionality so it's not recommended.

Setting the CPU affinity that controls which cores a process can run on might also be a workaround, depending on your OS's support for that.

@bobbrow bobbrow modified the milestones: Backlog, On Deck Apr 14, 2020
@sean-mcmanus sean-mcmanus modified the milestones: On Deck, 1.6.0 Jul 28, 2021
@sean-mcmanus sean-mcmanus self-assigned this Jul 28, 2021
@sean-mcmanus sean-mcmanus modified the milestones: 1.6.0, 1.7.0 Aug 17, 2021
@sean-mcmanus sean-mcmanus added the fixed Check the Milestone for the release in which the fix is or will be available. label Aug 17, 2021
@terriblefire
Copy link

Happens for me too. Makes my macOS system unusable when opening a large project (e.g. Mame) in VSCode.

@sean-mcmanus
Copy link
Contributor Author

@terriblefire This issue is only about the number of IntelliSense processes to spawn, and currently only 1 process spawns per file open up to around the core count -- do you have lots of files open? If you're seeing an issue with only 1 file open, then you're seeing a different issue (you may be seeing multiple threads from the same process).

@bobbrow bobbrow modified the milestones: 1.7.0, 1.8.0 Oct 19, 2021
@bruno-viva
Copy link

Happens to me too. I tried using vscode with the C++ plugins and it spawns 4 processes on my old laptop, which has 8GB RAM only. The cpptool-srv eats up all the memory and eventually I have to restart the computer.

@sean-mcmanus
Copy link
Contributor Author

This is available in https://github.com/microsoft/vscode-cpptools/releases/tag/1.8.0-insiders. The maximum number of IntelliSense processes can be configured with the C_Cpp.intelliSense.maxCachedProcesses setting, and the number of processes will automatically decrease when the free memory becomes < 256 MB and it can be configured to use less memory via the maxMemory settings (memory usage from code analysis is not handled yet).

@github-actions github-actions bot locked and limited conversation to collaborators Mar 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Feature Request fixed Check the Milestone for the release in which the fix is or will be available. Language Service performance
Projects
None yet
Development

No branches or pull requests

5 participants