-
Notifications
You must be signed in to change notification settings - Fork 30.8k
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
Extension host processes on Mac eating CPU (typing lag in vscode) #10439
Comments
Can you run a |
I have the same issue...it runs my fan constantly and burns through my battery. (No typing lag, though.)
Note: "Code Helper" also continues to run even after I've quit VSCode. My workspace is a Node.js module with most js files under 20KB. There are a few big-ish json files going up to 7 MB. The node_modules folder is pretty hefty, at ~300MB, mostly because of some CLDR dependencies. Funny, I closed VSCode and reopened it, and now I have two Code Helper processes going crazy: |
@dwbruhn Thanks for the info. Can pipe the output of the |
Same issue here, VSC 1.4.0 osx 10.11.6, without VSC running, Code Helper is consuming 100% of a cpu: $ ps -p 35565 35565 ?? 15486:08.03 /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper /Applications/Visual Studio Code.app/Contents/Resources/app/out/bootstrap --type=extensionHost Mine's been running over the last week and has racked up 257 hours of CPU time :) |
Here's mine:
I let it run for most of the day on Friday and the usage dropped down to a reasonable level, even while I was still working in VSCode. Just started making some edits today, though, and it's back up to ~100%. |
@bpasero Strangely, Code Helper isn't even near 100% today, even though I'm in the same workspace. If I can get it to reappear, I'll try the disable-extensions flag. |
I experience the same issue with vscode 1.4 on OS X 10.11.6. |
@marcevrard Interesting, I actually don't have that particular extension. Here are mine:
Looks like the TODO parser and Git History extensions updated in the last few days...possibly one of those was the culprit and has been fixed by the author? |
After removing
|
Okay, the high CPU usage reappeared. I shut down all the processes, then restarted VSCode with |
@dwbruhn One of the extensions (from your list) I uninstall during the debug was the Actually, to reproduce the issue, I used to open the User settings and close the right column window to focus on the Default settings window. Each time the problem occurred, I could see the linting in the status bar showing 2 warnings. When it did not occur, no warning was shown. So my intuition is that this issue is correlated to the linting process. |
@marcevrard Thanks for the tip! Code Helper spiked again today, so I shut it all down, uninstalled the markdownlint extension, and restarted VSCode. Looking good so far... |
@marcevrard Scratch that, it's sitting around 100% again... :-( |
I'm on Mac El Capitan. I've removed all extensions. I've disabled git (
If I kill Code Helper, it seems to not affect the running VS Code instance. Any suggestion? // edit |
Okay, I found a work-around after reading #10735 which seems related to this problem. Obviously this is not a solution, especially not for people who use typescript. |
I have had problems with the insider builds over the last 2-3 days where the editor freezes while I am editing typescript files. It usually begins lagging during the linting process. I thought this might have to do with some typescript refactor/import helper tools I have installed but removing these hasn't helped. |
cc @dbaeumer |
Yesterday i've added sass-lint extension and also CPU usage of Code Helper skyrocketed. I don't know if this is an issue with the linter itself or Code. PID TTY TIME CMD 693 ?? 167:21.66 /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper /Users/konrad/.vscode/extensions/glen-84.sass-lint-0.0.1/node_modules/vscode-languageclient/lib/utils/electronForkStart /Users/konrad/.vscode/extensions/glen-84.sass-lint-0.0.1/server/server.js |
Had the same issue; it was the Sass Lint (glen-84.sass-lint) extension for me. @jmhmd's suggestion of having UI to tell which extension has gone haywire is a great one. I'd love to see this included in the extensions panel! |
If anyone is seeing this sort of issue while working on JS/TS projects, please take a look at this bug which has been known to spike the extension host CPU: microsoft/TypeScript#14636 The workaround is to make sure any If you try the workaround but still see this issue while working with JS/TS, please open a new bug and we can take a look |
The issue with the sass-lint extension should be fixed in v0.0.4. Apologies for the inconvenience. |
For me |
This issue looks like a hot potato and it seems like I'm the one stuck with it for now :) After a re-read, to summarise:
Most simple repro:
I propose a somewhat realistic change:
Some other realistic things we could do: |
Maybe we could automate the instructions I came up with in #11963 (comment). |
The extension host can be started in debug mode easily but you have to do it from the command line when starting VS Code, not when it is already running:
|
One thing I've noticed that might or might not be a pattern: When switching from/to a external screen, it often triggers a 99% CPU usage. This might be the php extension, or it might be something else. |
Just filed a bug ☝️ for vscode-code-cover extension bmeck/vscode-code-cover#12. Apparently, it was breaking User Setting page in Visual Studio Code. Also, it seems like the same issue with git extensions went away for me once I uninstalled code coverage extension. Might be helpful for somebody watching this thread. |
I have met the same issue when I run py files and I also open the user settings @sjelfull mentioned. |
Hello there. Joining in on this old yet active thread. I have been experiencing exactly the same CPU & battery burning behaviour over the last 1 or 2 months with VSC on my MBP 2016. Unfortunately I cannot recall at what point exactly it started appearing or what particular thing I did to VSC at that time. Initial observations and first fix attemptsAfter having read through the discussions here as well as in duplicates / similar GitHub issues I have applied all suggested solutions I encountered without any effect though:
Even when disabling extensions I still have one of the Helper processes of VSC burning at ~130/150% CPU. Killing it does not help as it is respawned instantly with the same CPU burn. This is eating up my battery in a small 1 to 2 hours (!!) where as I was used to having 6/8 hours easy while coding before. Putting in this last data point just to emphasise how painful this issue is. Below a screenshot of I am willing to provide any other kind of tracing or whatsoever is helpful. ContextAll this was done with a project managed via Git and containing a large variety of different languages and tools, most for which I have extensions installed (C/C++, C#, Java, Scala, Go, Typescript, Markdown, Bash, Protobuf, CMake, Bazel, SWIG). However I only had C/C++ and Go files open in my VSC editor at the time of trying out the above action points. Extension list:
Further observationI have been able to reproduce this behaviour (i.e with extensions disabled) in some projects but not in others. It seems like it is somewhat related to the size of the project. After testing on 10 different projects (GitHub or other):
These are of course very rough and low accuracy estimates but it does look like a trend. Given that I can even observe this without any extensions enabled this looks to be a serious bug in VSC itself and not some badly coded third-party plugin. |
To help us figure out which area is to be blamed, is it possible for you to find out the command line arguments of the process that goes CPU crazy (it could be: the file watcher process, the extension host process, the search service process, the renderer process, the main process, etc.) ... (I've used |
@alexandrudima I'll have a look when I can in the very near future. From the top of my head it was the extension host process. |
@alexandrudima below is a screenshot, so it is actually the (file, I guess) watcher service. |
@bpasero I remember we used to have an option to turn off file watching, do we still have that? @Helcaraxan The only thing I found is |
@alexandrudima that is somewhat possible by setting: "files.watcherExclude": {
"**": true
} |
@alexandrudima Using the experimental file-watcher did indeed remove the process going wild. After rebooting with the option VSC took about 5 minutes burning full CPU (for file indexing probably) and another 10/15 minutes for the C++ extension to do some work. But after that no further CPU burn occurred. This is however a recurring start-up behaviour so I'd better not close any windows to often. |
That would be #3998 (high CPU with our classical file watcher). |
This issue has been closed automatically because it needs more information and has not had recent activity. Please refer to our guidelines for filing issues. Thank you for your contributions. |
Great job vscodebot. This is a serious issue that forces me to switch back to Atom. |
If you are still seeing high cpu usage, please open a new issue. There are multiple possible root causes of issue like this and it is generally much more productive to track each case separately |
Steps to Reproduce:
I tried uninstalling plugins but I don't know what to do that might be less of a time-suck. Maybe it's indexing for the go plugin or something, but it's making my editor unusable. And vscode without the go plugin is unusable for me too, so it's tricky.
The text was updated successfully, but these errors were encountered: