Vscode: VSCode eats memory and slows down my Macbook Pro

Created on 1 May 2016  Â·  56Comments  Â·  Source: microsoft/vscode

Steps to Reproduce:
One plausable reason:

  1. Install "npm commands"-extension and run your project from VSCode
  2. After a while the computer acts like an Windows Vista install on an old computer (imagine that!)

However:
Even though I did stop the npm stuff (didn't uninstall it though) it still drains my computer of all its powers.
So I'm not 100% sure it relates to the extension.

I'm sorry if this bug report is hard to understand. I'm writing this out of memory. I can try and reproduce it and update it if you haven't heard anything about this before.

candidate freeze-slow-crash-leak git important needs more info verified

Most helpful comment

It seems it is under control now. How is the limit determined?
screen shot 2016-06-13 at 10 52 05

All 56 comments

@rockymontana does this happen on all workspaces you open or maybe only on a very large one?

The one I use now isnt very large.
Its actually very small.

But yeah... When you mention it, I did uncheck an "ignore node_modules" for indexing (I guess?).
This so that I could easily go to my react components that I installed with npm. Because otherwise I had to scroll through the whole list of node modules which was a hastle.

And on that note - filtering on folder names when one starts to type in focused tree mode would be soooooo awesome :-)

On 02 May 2016, at 08:25, Benjamin Pasero [email protected] wrote:

@rockymontana does this happen on all workspaces you open or maybe only on a very large one?

—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub

@rockymontana what exactly did you uncheck and how and where?

I've noticed this recently, same versions of OS X/VS Code.

It's a medium sized project consisting of a couple node apps and a small website, I originally noticed it a few days ago when the typescript autocomplete was taking forever to load and eventually stopped working - I restarted VSCode and it would work again. I since noticed my whole machine.

Trying to work out what's causing it just now, but it looks like just opening a few js/ts/json files into the working file list caused it to use over 1.1GB of memory. I switched between debug/search/git tabs and it didn't seem to have an immediate effect, but in the few minutes I've written this it's now idling on 1.4GB.

@coggers can you please find out which of the multiple processes Code spawns is the one with a lot of memory in your case?

@bpasero It's Electron Helper

@coggers we need more info, the full command line of the helper! E.g. ps aux | grep helper

@bpasero same problem here, my process information:

09:45 $ ps aux | grep Electron
tang            74428 100.0  0.5  3386340  89256   ??  R    11:03AM 439:29.28 /opt/homebrew-cask/Caskroom/visual-studio-code/1.1.0,c212f0908f3d29933317bbc3233568fbca7944b1/Visual Studio Code.app/Contents/Frameworks/Electron Helper.app/Contents/MacOS/Electron Helper /Users/tang/.vscode/extensions/ms-vscode.jscs-0.1.5/node_modules/vscode-languageclient/lib/utils/electronForkStart /Users/tang/.vscode/extensions/ms-vscode.jscs-0.1.5/server/server.js
tang            14645   0.0  0.2  3252420  37760   ??  S     9:35AM   0:00.90 /opt/homebrew-cask/Caskroom/visual-studio-code/1.1.0,c212f0908f3d29933317bbc3233568fbca7944b1/Visual Studio Code.app/Contents/Frameworks/Electron Helper.app/Contents/MacOS/Electron Helper /opt/homebrew-cask/Caskroom/visual-studio-code/1.1.0,c212f0908f3d29933317bbc3233568fbca7944b1/Visual Studio Code.app/Contents/Resources/app/out/bootstrap --type=watcherService
tang            14610   0.0  0.0  2489644   3244   ??  S     9:35AM   0:00.01 /opt/homebrew-cask/Caskroom/visual-studio-code/1.1.0,c212f0908f3d29933317bbc3233568fbca7944b1/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Resources/crashpad_handler --database=/tmp/VSCode Crashes --url=https://ticinocrashreporter.azurewebsites.net/crash --handshake-fd=61
tang            43263   0.0  0.0  2545816   2752   ??  S    Wed05PM   0:00.40 /opt/homebrew-cask/Caskroom/visual-studio-code/1.1.0,c212f0908f3d29933317bbc3233568fbca7944b1/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Resources/crashpad_handler --database=/tmp/VSCode Crashes --url=https://ticinocrashreporter.azurewebsites.net/crash --handshake-fd=61
tang            11187   0.0  0.0  3220200   1124   ??  S    Wed11AM   0:01.02 /opt/homebrew-cask/Caskroom/visual-studio-code/1.1.0,c212f0908f3d29933317bbc3233568fbca7944b1/Visual Studio Code.app/Contents/Frameworks/Electron Helper.app/Contents/MacOS/Electron Helper /opt/homebrew-cask/Caskroom/visual-studio-code/1.1.0,c212f0908f3d29933317bbc3233568fbca7944b1/Visual Studio Code.app/Contents/Resources/app/out/bootstrap /usr/local/bin/git /Users/tang/Git Repositories/rakr-widget utf8 /opt/homebrew-cask/Caskroom/visual-studio-code/1.1.0,c212f0908f3d29933317bbc3233568fbca7944b1/Visual Studio Code.app/Contents/MacOS/Electron 2.8.2
tang             7897   0.0  0.0  2518316    500   ??  S    Wed11AM   0:00.03 /opt/homebrew-cask/Caskroom/visual-studio-code/1.1.0,c212f0908f3d29933317bbc3233568fbca7944b1/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Resources/crashpad_handler --database=/tmp/VSCode Crashes --url=https://ticinocrashreporter.azurewebsites.net/crash --handshake-fd=61

@tan9 that looks like the JSCS linter given the path of the 100% CPU. Please report to https://github.com/Microsoft/vscode-jscs

@rockymontana
A number of days has past without answer on the questions asked. I am thereby going to close this issue to clean up our backlog of issues. Once you can answer on the questions, the issue can be reopened again. Thanks for understanding this process!

I'm having a similar issue. Electron Helper is taking 50-150% CPU and eating up memory. This only happened since my update to version 1.2.0. It is happening while I have a react native project open with lots of node_modules inside.

My ps aux | grep Electron:

johngoering     13784  56.0  6.1  5044732 508708   ??  R    10:02AM  57:38.81 /Applications/Visual Studio Code.app/Contents/Frameworks/Electron Helper.app/Contents/MacOS/Electron Helper --type=renderer --no-sandbox --lang=en-US --node-integration=true --background-color=#131313 --num-raster-threads=2 --enable-zero-copy --enable-gpu-memory-buffer-compositor-resources --content-image-texture-target=3553,3553,3553,3553,3553,34037,3553,3553,3553,3553,34037,3553,34037,34037 --video-image-texture-target=34037 --channel=13437.1.1126164061
johngoering     13438   0.6  0.0  2787240   3144   ??  S    10:02AM   0:09.26 /Applications/Visual Studio Code.app/Contents/Frameworks/Electron Helper.app/Contents/MacOS/Electron Helper --type=gpu-process --channel=13437.0.1251607827 --no-sandbox --supports-dual-gpus=false --gpu-driver-bug-workarounds=16,17,31,36,40,50,54,61,67,70 --gpu-vendor-id=0x8086 --gpu-device-id=0x0166 --gpu-driver-vendor --gpu-driver-version
johngoering     15990   0.0  0.0  3192784   3100   ??  S    10:41AM   0:01.84 /Applications/Visual Studio Code.app/Contents/Frameworks/Electron Helper.app/Contents/MacOS/Electron Helper /Applications/Visual Studio Code.app/Contents/Resources/app/out/bootstrap --type=extensionHost
johngoering     15989   0.0  0.3  4066388  23252   ??  S    10:41AM   0:50.89 /Applications/Visual Studio Code.app/Contents/Frameworks/Electron Helper.app/Contents/MacOS/Electron Helper --type=renderer --no-sandbox --lang=en-US --node-integration=true --background-color=#131313 --num-raster-threads=2 --enable-zero-copy --enable-gpu-memory-buffer-compositor-resources --content-image-texture-target=3553,3553,3553,3553,3553,34037,3553,3553,3553,3553,34037,3553,34037,34037 --video-image-texture-target=34037 --channel=13437.3.1323918330
johngoering     13797   0.0  0.0  3220656   2584   ??  S    10:02AM   0:05.80 /Applications/Visual Studio Code.app/Contents/Frameworks/Electron Helper.app/Contents/MacOS/Electron Helper /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript/out/utils/electronForkStart /Users/johngoering/.vscode/node_modules/typescript/lib/tsserver.js
johngoering     13792   0.0  0.0  3407152   2704   ??  S    10:02AM   0:33.52 /Applications/Visual Studio Code.app/Contents/Frameworks/Electron Helper.app/Contents/MacOS/Electron Helper /Applications/Visual Studio Code.app/Contents/Resources/app/out/bootstrap /usr/bin/git /Users/johngoering/Documents/workspace/HDMobileIOS2/HelpDesk utf8 /Applications/Visual Studio Code.app/Contents/MacOS/Electron 2.7.4 (Apple Git-66)
johngoering     13788   0.0  0.0  3176584   2220   ??  S    10:02AM   0:01.62 /Applications/Visual Studio Code.app/Contents/Frameworks/Electron Helper.app/Contents/MacOS/Electron Helper /Applications/Visual Studio Code.app/Contents/Resources/app/out/bootstrap --type=watcherService
johngoering     13787   0.0  0.0  2465068    624   ??  S    10:02AM   0:00.02 /Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Resources/crashpad_handler --database=/tmp/VSCode Crashes --url=https://ticinocrashreporter.azurewebsites.net/crash --handshake-fd=63
johngoering     13785   0.0  0.0  3187528   2248   ??  S    10:02AM   0:01.85 /Applications/Visual Studio Code.app/Contents/Frameworks/Electron Helper.app/Contents/MacOS/Electron Helper /Applications/Visual Studio Code.app/Contents/Resources/app/out/bootstrap --type=extensionHost
johngoering     13783   0.0  0.0  3195472   2576   ??  S    10:02AM   0:03.39 /Applications/Visual Studio Code.app/Contents/Frameworks/Electron Helper.app/Contents/MacOS/Electron Helper /Applications/Visual Studio Code.app/Contents/Resources/app/out/bootstrap --type=SharedProcess
johngoering     13437   0.0  0.1  3538900   9172   ??  S    10:02AM   0:44.97 /Applications/Visual Studio Code.app/Contents/MacOS/Electron
johngoering      8271   0.0  0.0  3175740    828   ??  S     8:41AM   0:02.68 /Applications/Visual Studio Code.app/Contents/Frameworks/Electron Helper.app/Contents/MacOS/Electron Helper /Applications/Visual Studio Code.app/Contents/Resources/app/out/bootstrap /usr/bin/git /Users/johngoering/Documents/github/pdfc-samples utf8 /Applications/Visual Studio Code.app/Contents/MacOS/Electron 2.7.4 (Apple Git-66)
johngoering      7715   0.0  0.0  3397972    952   ??  S     8:33AM   0:33.36 /Applications/Visual Studio Code.app/Contents/Frameworks/Electron Helper.app/Contents/MacOS/Electron Helper /Applications/Visual Studio Code.app/Contents/Resources/app/out/bootstrap /usr/bin/git /Users/johngoering/Documents/workspace/HDMobileIOS2/HelpDesk utf8 /Applications/Visual Studio Code.app/Contents/MacOS/Electron 2.7.4 (Apple Git-66)
johngoering      7711   0.0  0.0  3175928    920   ??  S     8:33AM   0:01.78 /Applications/Visual Studio Code.app/Contents/Frameworks/Electron Helper.app/Contents/MacOS/Electron Helper /Applications/Visual Studio Code.app/Contents/Resources/app/out/bootstrap --type=watcherService
johngoering      7710   0.0  0.0  2473260    196   ??  S     8:33AM   0:00.04 /Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Resources/crashpad_handler --database=/tmp/VSCode Crashes --url=https://ticinocrashreporter.azurewebsites.net/crash --handshake-fd=63
johngoering     17571   0.0  0.0  2444056    792 s002  S+   11:18AM   0:00.01 grep Electron
johngoering     15995   0.0  0.0  3216476   3076   ??  S    10:41AM   0:02.14 /Applications/Visual Studio Code.app/Contents/Frameworks/Electron Helper.app/Contents/MacOS/Electron Helper /Applications/Visual Studio Code.app/Contents/Resources/app/out/bootstrap /usr/bin/git /Users/johngoering/Documents/github/pdfc-samples utf8 /Applications/Visual Studio Code.app/Contents/MacOS/Electron 2.7.4 (Apple Git-66)
johngoering     15991   0.0  0.0  3207220   3868   ??  S    10:41AM   0:01.12 /Applications/Visual Studio Code.app/Contents/Frameworks/Electron Helper.app/Contents/MacOS/Electron Helper /Applications/Visual Studio Code.app/Contents/Resources/app/out/bootstrap --type=watcherService

I am very sorry to hear you are having issues with VS Code. I wonder if this issue is being caused by an installed extension. Can you try to run VS Code without extensions? From the command line, execute: code --disable-extensions and try your steps again to see if it reproduces. If you see it is an issue with the extension, please file it against the extension repository itself.

OK I ran it again without extensions but still have the problem. Additionally I have tried to exclude the node_modules folder in the project, but the problem still occurs - after about 5 minutes, the CPU of Electron Helper went up to around 100%.

@epaga can you find out the full command line arguments and executable of the helper? we spawn many.

Pretty sure it's the

johngoering     13784  56.0  6.1  5044732 508708   ??  R    10:02AM  57:38.81 /Applications/Visual Studio Code.app/Contents/Frameworks/Electron Helper.app/Contents/MacOS/Electron Helper --type=renderer --no-sandbox --lang=en-US --node-integration=true --background-color=#131313 --num-raster-threads=2 --enable-zero-copy --enable-gpu-memory-buffer-compositor-resources --content-image-texture-target=3553,3553,3553,3553,3553,34037,3553,3553,3553,3553,34037,3553,34037,34037 --video-image-texture-target=34037 --channel=13437.1.1126164061

on the first post I made, but I will double-check

Yep here it is, this time with --disable-extensions. Note the "112.0" which is the CPU.

johngoering     30165 112.0  9.8  5288032 818944   ??  R     3:27PM   2:05.29 /Applications/Visual Studio Code.app/Contents/Frameworks/Electron Helper.app/Contents/MacOS/Electron Helper --type=renderer --no-sandbox --lang=en-US --node-integration=true --background-color=#131313 --num-raster-threads=2 --enable-zero-copy --enable-gpu-memory-buffer-compositor-resources --content-image-texture-target=3553,3553,3553,3553,3553,34037,3553,3553,3553,3553,34037,3553,34037,34037 --video-image-texture-target=34037 --channel=29793.1.527676201

@rockymontana @epaga can you guys try to run a chrome developer tools profile to see where the time is spend? you can bring up developer tools from the help menu and start the profile from the profile tab.

I am very greatful that this issue has been brought back to life.
But I don't have the time to spend on doing any testing unfortunately.
I have switched back to Atom again.

Sorry for the bad news… When you get Code stable enough I will switch back since I liked its' minimalistic interface, and I'm not a very big fan of Atom. So I'll check back in with you in a couple of versions when the "child deceases" (does one even say that in english or is it just us northern folk? ;) ) are taken care of.

Best of luck to you!

From: Benjamin Pasero
Reply-To: Microsoft/vscode
Date: Wednesday 8 June 2016 at 09:20
To: Microsoft/vscode
Cc: Jonas Erlandsson, Mention
Subject: Re: [Microsoft/vscode] VSCode eats memory and slows down my Macbook Pro (#6026)

@rockymontana @epaga can you guys try to run a chrome developer tools profile to see where the time is spend? you can bring up developer tools from the help menu and start the profile from the profile tab.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

94% of the CPU time is being spent in the function channel.onread in internal/child_process.js:426

Let me know if you need further info. This took me literally 1 minute.

@epaga great findings and this is exactly what we have seen in https://github.com/Microsoft/vscode/issues/7428

We still have to find out which of our processes is causing this flood of messages (extension host, search, file events).

Can you try to run from command line code --logExtensionHostCommunication and then bring up developer tools console (from help menu) to see what output is logged? This literally logs each and every request from and to the extension host and should be a lot of output if this is the place where CPU is burnt.

OK, I ran code --logExtensionHostCommunication but virtually nothing is being logged even though the CPU is at 100%. Each time I click somewhere in the editor, there is a log entry, so I know it is logging stuff. But if I just let it sit there, no new log messages are generated at all, even though the CPU fan is running at full blast due to the 100% CPU.

@epaga Any change you can put a breakpoint in that channel.onread method and look a bit into the content of the buffers in there?

It is even easily possible to add console.log statements to the child_process. I have recorded a video how to do so:

editors

@bpasero It is my belief that the buffer does not contain a \n, thus making it unbound and it might never enter the while loop, so best to add a console.log(jsonBuffer) on line 430

OK so after playing around a bit, it seems like @alexandrudima is right. The while loop is never entered. Additionally, the jsonBuffer keeps growing so there seems to be a memory leak as well.

One more thing - the locations in the JSON are not the folder I have opened in Visual Studio Code (which is a subfolder of the workspace folder you see in the JSON) - but outside it. It seems to be indexing folders outside the workspace folder?

screen shot 2016-06-10 at 09 32 20

Let me know any other debugging output that may be helpful.

@epaga are you sure this is not reproducing in our 1.1.x release? Can you try with https://az764295.vo.msecnd.net/stable/def9e32467ad6e4f48787d38caf190acbfee5880/VSCode-darwin-stable-unsigned.zip

@bpasero Huh, interesting, the same problem occurs with that download as well. All I know is I was working productively in that same folder for at least a couple of weeks with 1.1.??? and things were fine. It was only after the update to 1.2 (last Monday I think) that I noticed the high CPU. I am positive it wasn't happening before because the system literally becomes unusable after 10 minutes.

If you run git status from that folder, what do you get? The git repository reports that there are many untracked files. Maybe you have run git init from some folder that you did not intend to? Or added many new files inside the git repository to which your working folder belongs?

Yep that works around the problem. Somehow I ended up with a .git folder in my Documents folder, meaning all the files in all my Documents subfolders were listed as untracked. When I deleted it, the problem went away. Yay!

Would of course still be good if VS Code didn't try to index all of those files - and I'm still puzzled why it only started with 1.2 - but at least I can switch back from Atom now! :-) And so can @rockymontana if he had the same issue...

and I'm still puzzled why it only started with 1.2

Me too...

@rockymontana, @epaga, @coggers, @tan9, @J-Siu, @apratheek, @tjsail33, @troplin

We've pushed a few fixes that help mitigate this issue. Do you mind giving these bits a try for a few minutes and let me know whether you still see constant high CPU and increasingly editor slowness?

Thanks!

It seems it is under control now. How is the limit determined?
screen shot 2016-06-13 at 10 52 05

Over 5000 changes. Note that these are active changes, not files in repository.

Seems to be fine now.
But I've deleted the .git folder anyway, I'm fine with the official build.

But I still find it a bit excessive to scan all changed files in the tree after every change to a single file.

Kickass work and thanks a lot and sorry for being unhelpful earlier.

@joaomoreno
screen shot 2016-06-15 at 10 21 52 am

screen shot 2016-06-15 at 10 08 40 am

The problem seems to have been resolved in the Insider build, but seems to still exist on v1.2.1.

Anyhow, thank you for this. I missed VS Code the past few days.

@apratheek Ultimately, the issue is due to the user having initialised a git repository where one would not do so normally. The typical cases we saw have initialised one in their home folder. The real fix here is to remove that git repository. I suggest you do the same.

The fix we pushed simply mitigates this and prevents the browser window from slowness.

I see mentions of unbounded json string buffers growing due to lack of \n -- doesn't osx/unix use a \r for line breaks? :D

This is still happening for me on 1.3.1, OSX. It happens as soon as I open my project folder.

It isn't a big project at all, except for the node_modules that, as is often the case in the node ecosystem, is surprisingly big.

I'm only using 4 plugins: ESLint, OpenVim, Debugger for Chrome and Vim emulation.

I've tried excluding node_modules from indexing, to no effect:

"search.exclude": {
        "**/.git": true,
        "**/node_modules": true,
        "**/bower_components": true,
        "**/tmp": true
    }

Addendum: Electron helper keeps running after I command+Q VSCode, but I've checked that it's its Electorn Helper process and not some other electron-based app.

@jkurei What do you get with git status?

Also, what exactly is happening?

What happens is that Electorn Helper is eating 100% CPU and around 650MiB of Ram. My main issue is with the cpu, and my computer running its fans as if it wanted to take fly, I don't know how absurdly hight that RAM consumption is.

Right now git status shows:

> git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

    modified:   .gitignore
    modified:   actions/ActionTypes.js
    modified:   package.json
    modified:   webpack.config.js

Untracked files:
  (use "git add <file>..." to include in what will be committed)

    trips/

no changes added to commit (use "git add" and/or "git commit -a")

But i've had this same issue for a couple of days, also without any staged changed files.

I may have tracked it down. Yesterday I added .vscode to my .gitignore, but I didn't force quit the Electron Helper process.

Now with .vscode git-ignored, Electron Helper's CPU usage is only high right after starting VSCode. I'll test this out a bit more...

UPDATE: 😞 Nah, it's back at it; didn't change but a couple of js files.

How many changes does the git view report?

The same issue here. Fans crazy, code helper process eating 100,5% of the cpu and vbcode freezing at every key (press 1 key, wait 3 seconds or so, then the key is in the screen).
What should I do? I can make all the reports you want.

I have noticed which the last update of the vscode have increases the memory usage, as an memory leak, I don't know the reason of that.

It looks like to be the git extension again :(, I deleted the .git repository and this works fine.

@Ravencrow @caiocutrim Please create new issues for whatever you are seeing, and try to provide as much information as you can.

channel.onread of Node.js has bottleneck which repeatedly calls indexOf() on large buffer.
I sent PR to fix this: https://github.com/nodejs/node/pull/10557

It's consuming almost 2Gb of RAM and 98% of CPU with some PHP and Python extensions. VSCode killed my i3 Dell laptop.

@leandroramos That sounds like a problem with the extensions, not with vscode. Log an issue with the authors.

I've just experienced a very similar issue (maybe the same) on my pristine MacBook Pro (opened yesterday) running Mac OS 10.12.6. I installed VS code last night, I have 0 extensions installed and had nothing previously open in the app. crashpad_handler was using 130% CPU (Explained why the MacBook was huffing and puffing) I was not actively using VS Code!. When I used force quit on the process it crashed VS Code. As it happens googling crashpad_handler brought me here anyway.

Anyone got a good one-liner to quit all of these Code Helper processes at once?

This is a constant issue for me. After awhile of working, I'll notice my CPU starts to go nuts. Then, I exit Code and look at my activity monitor. Boom, tons of Code Helper instances running.

andrewmartin     69373   0.0  0.2  3222856  25368   ??  S     5:44PM   0:00.60 /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/json/node_modules/vscode-languageclient/lib/utils/electronForkStart /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/json/server/out/jsonServerMain.js --node-ipc
andrewmartin     69325   0.0  0.2  3231872  27124   ??  S     5:44PM   0:01.07 /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper /Users/andrewmartin/.vscode/extensions/eg2.tslint-1.0.9/node_modules/vscode-languageclient/lib/utils/electronForkStart /Users/andrewmartin/.vscode/extensions/eg2.tslint-1.0.9/server/server.js --node-ipc
andrewmartin     69324   0.0  0.8  3365384 132200   ??  S     5:44PM   0:08.39 /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript/out/utils/electronForkStart.js /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js --useInferredProjectPerProjectRoot --enableTelemetry --cancellationPipeName /var/folders/96/5p4gcyf97l17pqc3hc6j7yl40000gn/T/vscode-tscancellation-90814d74248265968063.sock*
andrewmartin     69321   0.0  0.4  3263988  60852   ??  S     5:44PM   0:03.12 /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper /Users/andrewmartin/.vscode/extensions/dbaeumer.vscode-eslint-1.3.2/client/node_modules/vscode-languageclient/lib/utils/electronForkStart /Users/andrewmartin/.vscode/extensions/dbaeumer.vscode-eslint-1.3.2/server/out/server.js --node-ipc
andrewmartin     69124   0.0  0.2  3232116  27688   ??  S     5:43PM   0:01.61 /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper /Users/andrewmartin/.vscode/extensions/eg2.tslint-1.0.9/node_modules/vscode-languageclient/lib/utils/electronForkStart /Users/andrewmartin/.vscode/extensions/eg2.tslint-1.0.9/server/server.js --node-ipc
andrewmartin     69120   0.0  0.3  3259440  47792   ??  S     5:43PM   0:04.56 /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper /Users/andrewmartin/.vscode/extensions/dbaeumer.vscode-eslint-1.3.2/client/node_modules/vscode-languageclient/lib/utils/electronForkStart /Users/andrewmartin/.vscode/extensions/dbaeumer.vscode-eslint-1.3.2/server/out/server.js --node-ipc
andrewmartin     68645   0.0  0.2  3222344  25652   ??  S     5:39PM   0:00.38 /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/json/node_modules/vscode-languageclient/lib/utils/electronForkStart /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/json/server/out/jsonServerMain.js --node-ipc
andrewmartin     68601   0.0  0.3  3223388  50644   ??  S     5:39PM   0:00.93 /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper /Users/andrewmartin/.vscode/extensions/eg2.tslint-1.0.9/node_modules/vscode-languageclient/lib/utils/electronForkStart /Users/andrewmartin/.vscode/extensions/eg2.tslint-1.0.9/server/server.js --node-ipc
andrewmartin     68597   0.0  0.3  3263460  52776   ??  S     5:39PM   0:03.97 /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper /Users/andrewmartin/.vscode/extensions/dbaeumer.vscode-eslint-1.3.2/client/node_modules/vscode-languageclient/lib/utils/electronForkStart /Users/andrewmartin/.vscode/extensions/dbaeumer.vscode-eslint-1.3.2/server/out/server.js --node-ipc

image

My usual process is to go in and kill these by clicking one by one in the Activity Monitor. Would love for these to not exist anymore :/ but was curious if anyone had a good copy paste snippet to blow them all out at once (for now).

fyi @dbaeumer see last comment

@alexandrudima thanks. Since this leaks LSP servers and TS I assume that the extension host didn't shutdown correctly. I did add code to the LSP that even without initialization installs a watch dog, but that one requires the node event loop being alive. Could I use your C++ implementation. It would be a check of a process id?

@dbaeumer I pinged because from the list of processes, none of them are the extension host.

The native-watchdog is not in a good enough state; it would also only help in case the nodejs event loop goes into an endless loop. i.e. it kills the current process if the event loop is unresponsive. Typically, that would be reflected in 100% CPU usage, which does not appear to be the case here.

@alexandrudima agree with the list but the tsserver is in there are well. So not only a LSP issue :-)
Regarding watch dog: I would be interested in a watch dog (native C++ thread) that checks the parent process id. If the process is gone the server could exit. No event loop checking. Could I start the watch dog in that mode ?

I am also seeing this issue in my Macbook Pro. It slows down my machine and when I am typing, also it shows 1 character in the time of typing 3 characters. My machine has 16GB RAM and i7 processor running.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shanalikhan picture shanalikhan  Â·  3Comments

chrisdias picture chrisdias  Â·  3Comments

curtw picture curtw  Â·  3Comments

trstringer picture trstringer  Â·  3Comments

biij5698 picture biij5698  Â·  3Comments