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

Code Helper is overloading CPU #11096

Closed
johanbove opened this issue Aug 29, 2016 · 32 comments
Closed

Code Helper is overloading CPU #11096

johanbove opened this issue Aug 29, 2016 · 32 comments
Assignees
Labels
info-needed Issue requires more information from poster
Milestone

Comments

@johanbove
Copy link

johanbove commented Aug 29, 2016

  • VSCode Version: Code 1.4.0 (6276dcb, 2016-08-04T16:41:29.513Z)
  • OS Version: Darwin x64 15.6.0

Steps to Reproduce:

  1. Open Visual Studio Code
  2. Open a project
  3. Open activity monitor and check that % CPU is over 100

ActivityMonitor analysis .txt file: https://www.dropbox.com/s/0zrsjo7c1aas4qs/ActivityMonitorCodeHelperAnalysis.txt?dl=0

@johanbove
Copy link
Author

Seems like a duplicate of #9572

@dbaeumer dbaeumer added the info-needed Issue requires more information from poster label Aug 29, 2016
@dbaeumer
Copy link
Member

@bpasero assigning to you. I saw that you had similar issues as well.

@johanbove could you please provide the command line of the Code Helper process causing the high CPU usage. And can you reproduce this without having any extension installed.

@bpasero bpasero added this to the Backlog milestone Aug 29, 2016
@johanbove
Copy link
Author

johanbove commented Aug 31, 2016

Thanks for the follow up @dbaeumer !
The tip from gerhardcit to add the bower_components folder to files.watcherExclude list helped.

Perhaps this folder should be added per default?

@bpasero
Copy link
Member

bpasero commented Aug 31, 2016

@johanbove is there something in that folder that you would need to be notified about? Disabling file events has consequences, e.g. the explorer not updating if something changes within. Do bower developers typically hide this folder from the explorer?

@bpasero
Copy link
Member

bpasero commented Aug 31, 2016

@johanbove actually is bower_components comparable to node_modules for node.js?

@johanbove
Copy link
Author

@bpasero Yes, in a way the bower_components is similar as when used in a project it contains third-party tools and libraries which are "imported" into a project. Bower is also a package manager: https://bower.io/

I'm not sure what Code Helper actually does, so unless a developer is working on a particular bower_component itself, I assume VSCode should not watch this folder for changes.

@johanbove
Copy link
Author

johanbove commented Aug 31, 2016

Update: I'm having the issue with the high CPU load again even-though so it looks like excluding the "bower_components" folder does not resolve the issue. How can Code Helper be analyzed to get details on what is it crunching on so intensively?

bildschirmfoto 2016-08-31 um 12 45 19

I have these extensions installed ($ code --list-extensions):

  • Arjun.swagger-viewer
  • EditorConfig.EditorConfig
  • ciena-blueplanet.vsc-ember-frost
  • dbaeumer.jshint
  • dbaeumer.vscode-eslint
  • felixrieseberg.vsc-ember-cli
  • glen-84.sass-lint
  • jeppeandersen.raml

@bpasero
Copy link
Member

bpasero commented Aug 31, 2016

@johanbove first thing is to find out the arguments of this process, e.g. is this really the file watcher or not. Can you provide this details?

@johanbove
Copy link
Author

@bpasero How do I get the arguments of the running process through Activity Monitor?

@bpasero
Copy link
Member

bpasero commented Aug 31, 2016

@johanbove from the command line "ps aux | grep <pid>" taking the PID from the activity monitor.

@johanbove
Copy link
Author

OK, started VSCode without extensions active with code --disable-extensions . and it seems to be running a lot "cooler" now. So it's probably an extension misbehaving. Will start again with all extensions active and when the Code Helper process goes berserk again I will execute the command to get to the arguments and will post back here.

@johanbove
Copy link
Author

Output for the arguments command; Code Helper PID 5205 raises CPU % over 100;

ps aux | grep 5205
johanbove        5205 100,1  3,6  3741216 598876   ??  R    12:57pm   1:02.72 /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=watcherService
johanbove        5260   0,0  0,0  2444056    824 s001  S+   12:58pm   0:00.00 grep 5205

@johanbove
Copy link
Author

johanbove commented Aug 31, 2016

But it went down again now... :-) Will keep an eye out for a Code Helper process which stays over 100% for longer periods and will report back here. Now that I know how to report this it'll be more helpful for sure.

@bpasero
Copy link
Member

bpasero commented Aug 31, 2016

@johanbove it is actually pretty easy: if you open VS Code on a large workspace, the file watcher has to walk each and every folder and file within. This causes high CPU spikes right on startup, independent from extensions. The only way to get this down is to set the files.watcherExclude on large folders that you do not look at.

Eventually though the CPU spike goes down and stays low. If you see this NOT happening, it defnitley is unexpected.

@johanbove
Copy link
Author

I pinpointed the CPU load issue to the extension: "glen-84.sass-lint-0.0.1"; Will contact the author of the plugin.

ps aux | grep 9566
johanbove        9566 161,8  3,1  3755952 516588   ??  S     8:13am  23:18.99 /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper /Users/johanbove/.vscode/extensions/glen-84.sass-lint-0.0.1/node_modules/vscode-languageclient/lib/utils/electronForkStart /Users/johanbove/.vscode/extensions/glen-84.sass-lint-0.0.1/server/server.js
johanbove        9848   0,0  0,0  2464536    880 s001  S+    8:27am   0:00.00 grep 9566

@johanbove
Copy link
Author

For future reference: here is the issue posted in the "sass-lint" project: glen-84/vscode-sass-lint#2

@bpasero
Copy link
Member

bpasero commented Sep 1, 2016

Thanks 👍

@hhstore
Copy link

hhstore commented Dec 1, 2016

+1.

  • VSCode Version: 1.7.2
  • OS Version: OSX 10.11.6

@kmturley
Copy link

kmturley commented Jan 24, 2017

Excluding bower/node/jspm folders could help:

Code -> Preferences -> User Settings

"files.exclude": {
    "**/.git": true,
    "**/.svn": true,
    "**/.hg": true,
    "**/.DS_Store": true,
    "**/bower_components": true,
    "**/jspm_packages": true,
    "**/node_modules": true
}

Otherwise can try using a different extension, this one seems to work:
https://marketplace.visualstudio.com/items?itemName=adamwalzer.scss-lint

See difference between them in performance:

screen shot 2017-01-24 at 1 00 20 pm

screen shot 2017-01-24 at 1 01 17 pm

@glen-84
Copy link

glen-84 commented Apr 12, 2017

The issue with the sass-lint extension should be fixed in v0.0.4.

Apologies for the inconvenience.

@johanbove
Copy link
Author

Thanks for fixing this! 👍

@besquared
Copy link

I started experiencing this as well after installing the recent "Angular Language Service" extension. Removed it for now and things seem to be back to normal.

@gbezyuk
Copy link

gbezyuk commented Jul 16, 2017

The same issue happens using vetour now, see vuejs/vetur#216

@nickytonline
Copy link

I'm seeing this issue as well with the latest VS Code. Here's what I have for extensions:
Bookmarks - Version :0.15.2
code-settings-sync - Version :2.8.2
debugger-for-chrome - Version :3.1.6
debugger-for-edge - Version :0.4.1
debugger-for-ios-web - Version :0.1.2
docthis - Version :0.4.7
EditorConfig - Version :0.9.4
gitblame - Version :2.0.2
gitflow - Version :1.1.1
githistory - Version :0.2.2
Go - Version :0.6.62
html-css-class-completion - Version :1.8.0
html-snippets - Version :0.1.0
javascript-unit-test-snippet - Version :1.0.0
JavaScriptSnippets - Version :1.4.1
jenkinsfile-support - Version :0.1.0
Material-theme - Version :2.9.8
nodejs-extension-pack - Version :0.1.9
npm-intellisense - Version :1.3.0
path-intellisense - Version :1.4.2
PowerShell - Version :1.4.1
prettier-vscode - Version :0.21.0
prettify-json - Version :0.0.3
project-manager - Version :0.18.1
quokka-vscode - Version :1.0.44
react-native-react-redux - Version :1.0.1
react-redux-es6-snippets - Version :2.1.0
rest-client - Version :0.14.6
Ruby - Version :0.12.1
sass-indented - Version :1.4.1
search-node-modules - Version :1.1.1
slack - Version :0.0.13
theme-dracula - Version :2.1.3
tslint - Version :0.17.0
typelens - Version :1.4.1
view-in-browser - Version :0.0.5
vscode-babel-coloring - Version :0.0.4
vscode-color - Version :0.4.1
vscode-docker - Version :0.0.16
vscode-eslint - Version :1.2.11
vscode-gutter-preview - Version :0.10.0
vscode-html-css - Version :0.1.7
vscode-jest - Version :2.2.0
vscode-markdownlint - Version :0.10.0
vscode-npm-script - Version :0.2.0
vscode-svgviewer - Version :1.4.2

Does anyone know if any of these extensions cause the CPU to make Code Helper spike to 100%?

@shikkaba
Copy link

I'm still seeing this.

@cklanac
Copy link

cklanac commented Aug 10, 2017

Just experience the same problem.

Comparing my extensions to @nickytonline list
I had two extensions in common:

  • githistory - But I have Version :0.2.3
  • npm-intellisense - Version :1.3.0

@altintx
Copy link

altintx commented Aug 14, 2017

I experience this problem most days. At this point all my extensions are disabled. 4 are installed but all are disabled:

  • Babel ES6/ES7 0.0.4
  • Docker 0.0.16
  • HTML Preview 0.1.1
  • vscode-open-project 0.0.9

@cklanac
Copy link

cklanac commented Aug 17, 2017

Update, I tracked my issue down to Code Spell Checker and a really large seed-data JSON file. Disabling Code Spell Checker solved my issues. To be fair to Code Spell Checker and @Jason-Rev, CSpell is a great extension. So the next step is to disable spell checking for targeted files.

@Jason3S
Copy link

Jason3S commented Aug 17, 2017

@cklanac Thank you! That gives me a place to start looking.
But it does not see to be the same issue as others.

@Jason3S
Copy link

Jason3S commented Aug 18, 2017

@cklanac can you open a new issue here: https://github.com/Jason-Rev/vscode-spell-checker/issues/ with some details about your setup.

Can you include things:

  • like OS and version.
  • Some information about the "really large seed-data JSON file"
    • Is it open in the editor
    • Is it automatically generated or updated.
    • Does excluding it in the cSpell.ignorePaths work?

Thank you.

@Moulde
Copy link

Moulde commented Oct 14, 2017

I don't have vs code open, and code helper is still eating my battery. Shouldn't this process close when i close vs code?

@drcmda
Copy link

drcmda commented Oct 19, 2017

Running VSC beta its constantly up 100% cpu until the computer becomes so slow that i can't type and click any longer.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests