-
Notifications
You must be signed in to change notification settings - Fork 28.2k
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
Code Helper high CPU usage on MacBook Pro 15 #11963
Comments
@pitAlex can you please find out the full arguments of this process to find out which process is causing high CPU load from the ones VS Code spawns as helpers. |
I'm having a similar issue with the Code Helper process. I have disabled all extensions. It appears to be steadily getting worse. It was minor annoyance a few weeks ago, I would occasionally just kill the Code Helper process and be back to normal again. Now the Code Helper just eats 100% of a core almost all of the time now. I even see this happen on occasion now: |
@cjdell also please find out the full arguments of the process that goes ballistic: |
@bpasero Here you go:
|
@bpasero I'll post as soon as it happens again, I didn't look at arguments last time it did. |
May also be relevant, my project directory has 82097 files, though all but about 2000 of those files are excluded in |
We've seen similar reports with many 'find' processes sticking around. So far I assumed these were triggered by #11181 because the user might have opened-closed QuickOpen a few times while 'find' is taking some time due to #11874, yet it seems there is more to it. Any idea why 'find' might stay around? @cjdell To confirm this is something else: Could you run |
happening to me as well CPU hog is this command:
|
I'm experiencing something similar to @cjdell: vs code spins up a bunch of 'find' processes that eat up a huge amount of CPU time when searching for files, and searching for files hang. The project I'm running into this with has a huge dependency tree, all of which should be excluded by the Am not experiencing the same issue in smaller projects. This was not an issue before this morning, when I updated to 1.5.2 (not sure what my previous version was...). |
|
@bpasero The Code Helper process taking 100% CPU is now the |
@bpasero Thanks, I've added the |
Whilst the Code Helper isn't hogging the CPU anymore. Still occasionally seeing 10+ |
@chrmarti Just trying the insiders build now. Still has the nasty |
@cjdell That's an interesting data point, I haven't been able to reproduce that. Could you share your user and workspace settings with us? |
@chrmarti I'm on entirely default settings apart my excludes:
My project is pretty large though (not enormous) so I'm sure that's a contributing factor. I posted the stats earlier on this issue. It's an Ember project that I'm working on. |
@cjdell You might hit a limitation of our glob optimizations. Could you remove the trailing '/**' from the files.exclude patterns and retry? That should make my fix from yesterday actually work. |
I found a workaround for extension host generating high CPU and requiring a window reload. In my case at least, when I save a file I see the "git" process running high CPU usage and then the extension helper using up lots of CPU and eventually dying. My situation: I have a git repo in my home directory for managing a handful of dot-files but no git repo inside my development subdirectory. The cmd-line git client shows only a few files being actively managed by git and hundreds of untracked files / dirs. I suspect that the VSC git process is trawling this entire repository; whereas the cmd-line git client returns immediately with the status. Walking the filesystem is really slow: shell$ find ~ -type f | wc -l requires more than 30 seconds to complete due to hundreds of thousands of files in the OS X Library directory, ~/Library. Workaround: Doing a git init in my project directory created an empty git repo that that superseded the repo in ~. I now see the Code Helper process peak slightly the first time I save a file and is fine on subsequent saves. |
me too same problem here |
In my case the extension causing the extended CPU spike was Code Spellchecker (ping @Jason-Rev). I uninstalled the extension, force quit that particular Code Helper process in the Mac's Activity Monitor app, and restarted VS Code. My laptop fan is much happier now. Of note, I installed Code Spellchecker a couple of weeks ago and didn't have any issues. It wasn't until VS Code updated to v1.12.2 a couple of days ago that the CPU spike started happening. VersionsVS Code: 1.12.2
I found the extension causing the CPU spike by finding the PID in the Activity Monitor and then
|
I have seen and issue with the VS Code update process (Updating VS Code, not the extensions), where the extension does not shut down. When that happens, the orphaned extension can end up using a lot of CPU power. @everett-toews If you re-install the spell checker, does it still use a lot of CPU? |
@Jason3S Thanks for getting back to me. I reinstalled Code Spellchecker and it's still using a lot of CPU. I started a tracking issue in streetsidesoftware/vscode-spell-checker#94 |
➜ ~ Sampling process 4532 for 3 seconds with 1 millisecond of run time between samples Date/Time: 2017-05-23 19:41:19.378 +0800 |
same here: ps aux | grep 4881 |
Suddenly it happens again when opening bootstrap admin theme from https://www.creative-tim.com/product/light-bootstrap-dashboard. |
@cevarief Could you open a new issue (Help > Report Issues) and include the command line arguments of the process causing the high cpu usage? (This likely a new issue.) |
Hi @chrmarti, Yes sure. Thank you. |
Happening to me at random. I have to quit vscode, and terminate the orphaned high cpu usage CodeHelper manually. This is in OSX Sierra. |
I've disabled all installed extensions and this problem is still with me. Every time I open a Looks like it's -- update1 (workaround) -- -- update2 --
|
why is this issue closed? i just had this. code helper 100% cpu on each core. and then after code helper shut itself down. the find process went to 100% latest everything |
@trivita I suggest opening a new issue. Each one of these Code Helpers can have a different cause. |
Since my last response in this thread, I've switched to windows 10 full time (surface pro). I have the exact same extensions installed as on my macbook pro, and there is absolutely no issues with high CPU usage or memory leaks. Probably not helpful info to most, but this confirms that it's isolated on macOS (even if extensions are to blame). |
I experienced the same problems in (version 1.14.2) with a really big project. By adding the following config and restarting the editor it seems to be resolved: {
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/tmp": true,
"**/node_modules": true,
"**/bower_components": true,
"**/dist": true
},
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/.git/subtree-cache/**": true,
"**/node_modules/**": true,
"**/tmp/**": true,
"**/bower_components/**": true,
"**/dist/**": true
}
} The |
It's also worth noting that if you tend to keep a vsCode window open in a large 'non project' folder (such as your user home directory), the Code Helper is naturally going to soak up a lot of resource as it tries to parse every sub directory. Using the above as a starting point, you can create greedy exclusion patterns that prevent the Code Helper from going any further than your root directory. |
I tried all the possible things:
Some options even slowed down processing, but what really did effect was adding these settings you mentioned. Thank you all! |
In my case this was caused by too many files in the project directory. VS Code starts a number of
This has overhead, even for excluded/unwatched directories. Running the command from the project directory ended yielded a massive number of files in |
For me, even after closing the program I still have 99.2% cpu usage 10 minutes later (2015 mbp 13 inch, high sierra). Why is the issue closed? edit: tried fedekau's settings, seems to be working for now. |
Same problem here, VScode with 0 file open => 100% CPU usage (never go under 96%) My laptop cant' cool down and my keyboard is burning!! (MBP retina 15" on High Sierra) My VScode settings:
|
@jimblue and @javenschuetz, Please open a new issue and refer to this one. |
I'm going to lock this issue - anyone with similar issues, please see https://github.com/Microsoft/vscode/wiki/Performance-Issues and open a new issue. |
I've notice there are several closed posts related to this issue, but it started to act up again. Before 1.5.2 I was using 1.3 since 1.4 had a problem with syntax highlighting and from time to time I used to get high cpu from "electron helper" even tough I have git disabled and only 3 extensions : "Project Manager", "Run on Save" and "HTML CSS Support". I upgrade to 1.5 and now Code Helper is the one that does it. I can happen 2, 3 times per day. It doesn't matter if you have lots of files opened or not, or if you are doing some had work, it just happens randomly. Once I left it minimize more then half an hour and my fans just started up suddenly as a result of the Code Helper going up to 99.9 CPU usage.
I've attached a screenshot showing the usage :
The text was updated successfully, but these errors were encountered: