You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Extension host processes on Mac eating CPU (typing lag in vscode) #10439
bugIssue identified by VS Code Team member as probable bugextension-hostExtension host issuesfreeze-slow-crash-leakVS Code crashing, performance, freeze and memory leak issuesinfo-neededIssue requires more information from poster
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.
Reacted by Daniel Bruhn, Michael Müller, ezkay, Matt MacPherson, Mario Brandao, Aykut Çevik, Artur Ampilogov, Felipe Borges Ferreira, Nathan Broadbent, Cameron Nokes and 13 more
Can you run a ps -p <PID> to get more information about the process, esp its command line. That will allow us to figure out what process is going crazy... Any other insights about your workspace, like what files (go, JavaScript, TypeScript, etc)? Size? etc
I have the same issue...it runs my fan constantly and burns through my battery. (No typing lag, though.)
VSCode Version: 1.4.0
OS Version: OS X El Capitan 10.11.6
10:25:09] $ ps -p 78859
PID TTY TIME CMD
78859 ?? 3:30.61 /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper /Applications/Visual Stu
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:
Reacted by ezkay, Felipe Borges Ferreira, Nathan Broadbent and Dave Gillem
Daniel Bruhn (@dwbruhn) Thanks for the info. Can pipe the output of the ps -p command to a file? Unfortunately the important bits of the arguments are cropped in your sample...
PID TTY TIME CMD
21572 ?? 10:36.69 /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
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%.
changed the title [-]Code Helper processes on Mac eating CPU (typing lag in vscode)[/-][+]Extension host processes on Mac eating CPU (typing lag in vscode)[/+]on Aug 16, 2016
Benjamin Pasero (@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.
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.
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 attempts
After 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:
updated my go tools (as this was mentioned somewhere and I use VSC for Go quite a lot).
disabled Git support.
disabled / uninstalled my Markdown extension.
looked for other culprit extensions by disabling them one-by-one, quitting and restarting VSC, before checking the CPU again.
starting VSC with --disable-extensions.
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 top -pid <1> -pid <2> ... with all the PIDs in the VSC process-tree:
I am willing to provide any other kind of tracing or whatsoever is helpful.
Context
All 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.
I 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):
Repo size on disk > 750 MB - Reproducable (2 projects, 850MB and 1.5 GB)
Repo size on disk < 750 MB - Not reproducable (8 projects, one around 500 MB and the rest below 200 MB)
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 htop in the past to figure out the full process command line).
Benjamin Pasero (@bpasero) I remember we used to have an option to turn off file watching, do we still have that?
Duco van Amstel (@Helcaraxan) The only thing I found is files.useExperimentalFileWatcher, maybe you can try setting that to true to see if the situation improves for your workspace. Additionally, you could use files.watcherExclude to exclude resources such as build artefacts, etc. Please let us know how it goes.
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.
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.
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
bugIssue identified by VS Code Team member as probable bugextension-hostExtension host issuesfreeze-slow-crash-leakVS Code crashing, performance, freeze and memory leak issuesinfo-neededIssue requires more information from poster
Activity
jrieken commentedon Aug 12, 2016
Can you run a
ps -p <PID>to get more information about the process, esp its command line. That will allow us to figure out what process is going crazy... Any other insights about your workspace, like what files (go, JavaScript, TypeScript, etc)? Size? etcdwbruhn commentedon Aug 12, 2016
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:
jrieken commentedon Aug 15, 2016
Daniel Bruhn (@dwbruhn) Thanks for the info. Can pipe the output of the
ps -pcommand to a file? Unfortunately the important bits of the arguments are cropped in your sample...mh720 commentedon Aug 15, 2016
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 :)
dwbruhn commentedon Aug 15, 2016
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%.
[-]Code Helper processes on Mac eating CPU (typing lag in vscode)[/-][+]Extension host processes on Mac eating CPU (typing lag in vscode)[/+]bpasero commentedon Aug 16, 2016
Lindsey Simon (@elsigh) Daniel Bruhn (@dwbruhn) so does this reproduce even when you run without extensions loaded (using
code --disable-extensions)?dwbruhn commentedon Aug 16, 2016
Benjamin Pasero (@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.
70 remaining items
skhilko commentedon May 22, 2017
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.
burness commentedon May 25, 2017
I have met the same issue when I run py files and I also open the user settings Fred Carlsen (@sjelfull) mentioned.
Helcaraxan commentedon Jul 8, 2017
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 attempts
After 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:
--disable-extensions.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
top -pid <1> -pid <2> ...with all the PIDs in the VSC process-tree:I am willing to provide any other kind of tracing or whatsoever is helpful.
Context
All 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 observation
I 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.
alexdima commentedon Aug 10, 2017
Duco van Amstel (@Helcaraxan)
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
htopin the past to figure out the full process command line).Helcaraxan commentedon Aug 10, 2017
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.
Helcaraxan commentedon Aug 10, 2017
alexandrudima below is a screenshot, so it is actually the (file, I guess) watcher service.
alexdima commentedon Aug 11, 2017
Benjamin Pasero (@bpasero) I remember we used to have an option to turn off file watching, do we still have that?
Duco van Amstel (@Helcaraxan) The only thing I found is
files.useExperimentalFileWatcher, maybe you can try setting that to true to see if the situation improves for your workspace. Additionally, you could usefiles.watcherExcludeto exclude resources such as build artefacts, etc. Please let us know how it goes.bpasero commentedon Aug 11, 2017
alexandrudima that is somewhat possible by setting:
Helcaraxan commentedon Aug 11, 2017
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.
bpasero commentedon Aug 11, 2017
That would be #3998 (high CPU with our classical file watcher).
vscodebot commentedon Aug 18, 2017
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.
nikoanzai commentedon Nov 1, 2017
Great job vscodebot. This is a serious issue that forces me to switch back to Atom.
mjbvz commentedon Nov 2, 2017
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