Skip to content

Extension host processes on Mac eating CPU (typing lag in vscode) #10439

Closed

Description

@elsigh
  • VSCode Version: 1.4
  • OS Version: OSX Mavericks 10.11.6

Steps to Reproduce:

  1. Open my project
  2. image

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.

Activity

  1. jrieken commented on Aug 12, 2016

    @jrieken
    Contributor

    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

  2. added
    info-needed
    freeze-slow-crash-leak
    on Aug 12, 2016
  3. dwbruhn commented on Aug 12, 2016

    @dwbruhn

    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

    image

    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:

    image

  4. jrieken commented on Aug 15, 2016

    @jrieken
    Contributor

    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...

  5. mh720 commented on Aug 15, 2016

    @mh720

    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 :)

  6. dwbruhn commented on Aug 15, 2016

    @dwbruhn

    Here's mine:

      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%.

  7. 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
  8. bpasero commented on Aug 16, 2016

    @bpasero
    Contributor

    Lindsey Simon (@elsigh) Daniel Bruhn (@dwbruhn) so does this reproduce even when you run without extensions loaded (using code --disable-extensions)?

  9. dwbruhn commented on Aug 16, 2016

    @dwbruhn

    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.

  10. 70 remaining items

  11. skhilko commented on May 22, 2017

    @skhilko

    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.

  12. burness commented on May 25, 2017

    @burness

    I have met the same issue when I run py files and I also open the user settings Fred Carlsen (@sjelfull) mentioned.

  13. Helcaraxan commented on Jul 8, 2017

    @Helcaraxan

    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:

    screen shot 2017-07-08 at 11 45 01

    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):

    • 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.

  14. alexdima commented on Aug 10, 2017

    @alexdima
    Member

    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 htop in the past to figure out the full process command line).

  15. Helcaraxan commented on Aug 10, 2017

    @Helcaraxan

    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.

  16. Helcaraxan commented on Aug 10, 2017

    @Helcaraxan

    alexandrudima below is a screenshot, so it is actually the (file, I guess) watcher service.

    screen shot 2017-08-10 at 16 52 36

  17. alexdima commented on Aug 11, 2017

    @alexdima
    Member

    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.

  18. bpasero commented on Aug 11, 2017

    @bpasero
    Contributor

    alexandrudima that is somewhat possible by setting:

    "files.watcherExclude": {
        "**": true
    }
  19. Helcaraxan commented on Aug 11, 2017

    @Helcaraxan

    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.

  20. bpasero commented on Aug 11, 2017

    @bpasero
    Contributor

    That would be #3998 (high CPU with our classical file watcher).

  21. vscodebot commented on Aug 18, 2017

    @vscodebot

    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.

  22. nikoanzai commented on Nov 1, 2017

    @nikoanzai

    Great job vscodebot. This is a serious issue that forces me to switch back to Atom.

  23. locked and limited conversation to collaborators on Nov 2, 2017
  24. mjbvz commented on Nov 2, 2017

    @mjbvz
    Contributor

    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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugextension-hostfreeze-slow-crash-leakinfo-needed

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions