77

I noticed that my MacBook gets hot and noisy (fans) when using VS Code (v1.31). The Activity Monitor shows the process Code Helper using more than 100% of CPU. It started happening with one repository which is huge. Only one window opened, no files opened, and it always uses more than 100% CPU.

Checking in Microsoft/GitHub, there was an issue reported but they closed it saying "This issue has been closed automatically because it needs more information and has not had recent activity." , but it is still an ongoing issue. I tried some of the recommendations in the comments but didn't work.

Does anybody has more info and/or know how to avoid this? Is it possible to make some configurations for VS Code to not burn the MacBook?

3
  • While this is not explicitly a programming related question you might have a better audience for this type of question at stackexchange.com. As that is a board explicitly for programmers an d questions about programming. Just a thought. Commented Feb 18, 2019 at 14:48
  • 3
    Having the same issue. I have a very large project open and it's using 300% CPU right now, even though it's not doing anything. Commented Feb 26, 2019 at 7:52
  • It since seems to have stopped doing whatever it was doing. I don't know what it was doing as I disabled most extensions, but it's not using any significant resources at the moment. Commented Feb 26, 2019 at 19:38

11 Answers 11

54

This is most likely an issue with a plugin in VS Code. For me, it was Pyright.

How to check?

  • Open Activity Monitor
  • Within the list of prcesses, find the one that has the highest CPU usage (it should already be at the top).
  • For this process, find the PID number.
  • Then, within terminal, type this:

    ps aux | grep 20295

  • note that you should change "20295" to the PID number that you found in step 3

This should give you the information as to which extension it is. I, personally, would remove it, but that's up to you. At the very least, please contact the maintainer of that package and make sure that they are aware of the issue.

After removing the extension, exit VS Code, wait for a bit while the fans slow down and then start again. It shouldn't give you a problem now.

Happy coding!

7
  • 3
    Where in the string would you find this? I could not find any indication of the plugin in mine. Commented Jan 5, 2022 at 0:39
  • 1
    Code Helper (Renderer) is the highest CPU and energy consuming process on my machine and I also see no information about plugins in the output.
    – Stephen
    Commented Oct 12, 2022 at 16:17
  • The name of executable contains the extension name: /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper --ms-enable-electron-run-as-node /Users/<username>/.vscode/extensions/bmewburn.vscode-intelephense-client-1.8.2/node_modules/intelephense/lib/intelephense.js --node-ipc --clientProcessId=30825. Here intelephence is the extension. Commented Dec 27, 2022 at 6:58
  • 1
    Your steps works. In my case was a great Live Server extension: marketplace.visualstudio.com/… - So I need a substitute to it.
    – erfelipe
    Commented May 1, 2023 at 13:52
  • It did really helped me. Commented Oct 25, 2023 at 4:26
17

Killing processes on mac with kill -9 [PID] and restarting VSC helped me to solve the problem.

if not, refer to https://github.com/microsoft/vscode/issues/11963#issuecomment-317830768

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
    }
}
2
12

In my case it was Settings Sync v3.4.3. Once i disabled it, the problem is gone !

Screenshot of the extension attached (just disable or uninstall this).

enter image description here

3
  • 3
    This worked for me too. I tried a few other suggestions but when I checked Settings Sync in the Extensions it said it was deprecated. Once I uninstalled the extension and reloaded my CPU usage has dropped dramatically.
    – soutarm
    Commented Jan 10, 2023 at 1:57
  • 1
    I've been plagued by this for years now. Each window would basically take up an entire CPU (or more) and the only way to clean this was to do a complete new install and resync my settings. Then within months, the same thing would happen again. Now that this extension is deprecated and settings sync is just native to VScode now, I've deleted this and each window no longer eats up a CPU. You have saved me from a life of utter anguish!
    – shoebox639
    Commented Apr 14, 2023 at 14:26
  • Same here. The clue was that when I closed Code Helper in Activity Monitor and it restarted again, it was always Settings Sync which popped back up in VSCode.
    – Tim Malone
    Commented Oct 30, 2023 at 5:00
6

For React Native developers, try adding the expo folder in the vscode configuration to the "files.watcherExclude" . There are too many large files in that folder and its cache folder.

{
  **/node_modules/**,
  **/.expo/**
}
0
4

The behaviour you describe could either be a bug in VS Code or it is intended behaviour simply because the numbers of files you have require large amounts of CPU time to process. I strongly suspect that the problem is a bug.

The issue you have found have the same externally observables as your problem, i.e. the CPU usage of Code Helper is very high. However there could be many different reasons for that to happen. Therefore it is not a problem that that specific issue has been closed for outside comments.

I would highly suggest opening a new issue instead. Go to this page:

https://github.com/Microsoft/vscode/issues

And click the "New issue" button. Select that you want to file a "Bug report". Then please describe everything carefully, including which of the recommendations you have tried that did not work.

Hopefully the VSCode team will be able to fix the bug and release a new and fixed version.

1
  • I did a cpu profile and all of it is assigned to "(Program)"
    – Marc
    Commented Jul 25, 2019 at 12:32
3

For those arriving in 2022, the newer versions of yarn have a local cache of all of the packages, which should be excluded.

This worked for me as a project file .vscode/settings.json

{
  "files.exclude": {
    "**/.yarn/cache": true
  },
  "files.watcherExclude": {
    "**/.yarn/cache/**": true
  }
}

1
  • There is no mention of yarn. How does this answer the original question?
    – agarza
    Commented Aug 27, 2022 at 19:47
1

I have a markdown file within LaTeX which caused the Code Helper process to consume 100% of CPU resources.

I checked the extensions and noticed that, when I disable the Markdown+Math extension, CPU usage goes down immediately.

I use the Markdown+Math extension to preview markdown files within LaTeX. I uninstalled the extension, and use now "Markdown Preview Enhanced".

1

I tried stable VSCode and insiders VSCode on the absolute same project and same extensions.

The CPU hurt happens only in stable build and not in insiders.

I have to sometimes use the stable build because some features break in the insiders from time to time.

This is something already fixed in Insiders but is not being pushed to stable. It's been annoying me for months.

1

It might be one of your installed extensions.

In my case, it was code-spell-checker.

So it you are having it too, as others, I suggesting disabling extensions, one by one, until you find the problematic one.

In the case of Spell Checker, it seems to be affecting projects with large files, so excluding tmps, logs, etc, from view/search might not be enough if you do have large files with code.

1

Just had this bug on a completely new device with a fresh installation of VS Code. I only opened it for a minute to see that it works, I have not even opened a file or installed any extensions at all. Also, code helper kept running and consuming energy after I quit VS Code.

1
1

I had the same problem and tried everything written in the community, but none of them worked for me. After some trying I found out what the problem was.

I had an unsaved (opened as a new tab but not saved) tab in VsCode, which was a problem for me. Closing these tabs and restarting vsCode fixed it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .