Vscode: VSCode uses too much RAM upon Updating to latest version (1.20.1)

Created on 21 Feb 2018  Â·  65Comments  Â·  Source: microsoft/vscode

  • VSCode Version: 1.20.1
  • OS Version: Windows 10

Steps to Reproduce:

  1. Open VSCode on Windows 10
  2. Open task manager :

vs code


Does this issue occur when all extensions are disabled?: Yes/No

Yes, because it still uses at around 500mb:

vscode2

I remembered it uses much less memory than that prior to updating...

needs more info

Most helpful comment

I switched to emacs and I am loving it.

All 65 comments

Without more details I will close this issue, unless you can pinpoint this to a specific thing you are doing...

Can you try to reproduce with our nightly insider builds? You can give our preview releases a try from: https://code.visualstudio.com/insiders/

I'm not doing anything to be honest, I opened my project with VSCode (An Angular app), edited some code, then I noticed the editor being unresponsive most of the time that's when I decided to open task manager and saw it uses a lot of memory...

@wtubog ok so the editor getting unresponsive when editing files is not normal and might be unrelated to the memory consumption. When this happens again, can you run "code --status" and attach the output?

Collecting CPU and memory information. This might take a couple of seconds.

Version: Code 1.20.1 (f88bbf9137d24d36d968ea6b2911786bfe103002, 2018-02-13T15:34:36.336Z)
OS Version: Windows_NT x64 10.0.16299
CPUs: Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz (8 x 1800)
Memory (System): 7.86GB (3.78GB free)
VM: 0%
Screen Reader: no
Process Argv: C:\Program Files\Microsoft VS Code\Code.exe .
CPU % Mem MB PID Process
0 79 16828 code main
0 66 7564 shared-process
0 118 7612 gpu-process
0 217 11940 window (header.component.ts - vetfo - Visual Studio Code)
0 30 6484 terminal
0 6 9808 winpty-process
0 9 10152 console-window-host (Windows internal process)
0 5 17184 "C:\Program Files\Git\bin\bash.exe"
0 9 2520 "C:\Program Files\Git\bin..\usr\bin\bash.exe"
0 72 6824 extensionHost
0 162 8304 electron_node electronForkStart.js tsserver.js
0 35 14580 electron_node typingsInstaller.js tsserver.js typesMap.js
0 39 11752 electron_node jsonServerMain.js
0 235 15224 electron_node server.js
0 12 7232 electron-crash-reporter
0 33 11832 searchService
0 13 15080 watcherService
0 9 14048 console-window-host (Windows internal process)

Workspace Stats:
| Window (header.component.ts - vetfo - Visual Studio Code)
| Folder (vetfo): 112 files
| File types: ts(31) css(20) json(11) html(10) svg(6) js(6) txt(5) png(3)
| eot(3) ttf(3)
| Conf files: package.json(1) tsconfig.json(1) tslint.json(1)

This is the output when I run code with --disable-extensions (event though I disabled the extensions, VSCode still takes a lot memory):

Collecting CPU and memory information. This might take a couple of seconds.

Version: Code 1.20.1 (f88bbf9137d24d36d968ea6b2911786bfe103002, 2018-02-13T15:34:36.336Z)
OS Version: Windows_NT x64 10.0.16299
CPUs: Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz (8 x 1800)
Memory (System): 7.86GB (3.85GB free)
VM: 0%
Screen Reader: no
Process Argv: C:\Program Files\Microsoft VS Code\Code.exe . --disable-extensions
CPU % Mem MB PID Process
0 83 1476 code main
3 78 8180 shared-process
0 123 9572 gpu-process
0 295 12360 window (header.component.ts - vetfo - Visual Studio Code)
0 13 3196 watcherService
0 10 8432 console-window-host (Windows internal process)
0 12 9764 electron-crash-reporter
0 56 14128 extensionHost
0 5 9628 "C:\Program Files\Git\cmd\git.exe" fetch
0 10 7636 console-window-host (Windows internal process)
0 5 15548 git.exe fetch
0 5 11928 git remote-https origin https://github.com/wtubog/vfo.git
0 11 6480 git-remote-https origin https://github.com/wtubog/vfo.git
0 6 8012 sh -c "git credential-manager get" "git credential-manager get"
0 5 1956 "C:\Program Files\Git\mingw64libexec\git-core\git.exe" credential-manager get
0 26 4260 git-credential-manager get
0 165 10472 electron_node electronForkStart.js tsserver.js
0 35 7744 electron_node typingsInstaller.js tsserver.js typesMap.js
0 39 16976 electron_node jsonServerMain.js
0 31 17176 terminal
0 6 9760 winpty-process
0 10 8452 console-window-host (Windows internal process)
0 5 11996 "C:\Program Files\Git\bin\bash.exe"
0 10 16768 "C:\Program Files\Git\bin..\usr\bin\bash.exe"
Workspace Stats:
| Window (header.component.ts - vetfo - Visual Studio Code)
| Folder (vetfo): 112 files
| File types: ts(31) css(20) json(11) html(10) svg(6) js(6) txt(5) png(3)
| eot(3) ttf(3)
| Conf files: package.json(1) tsconfig.json(1) tslint.json(1)

@wtubog a screenshot of it would help reading the output

capture1

capture2

Thanks, I am not seeing an outlier here, seems legit so far.

@wtubog does it freeze when you open a particular file?

Yes it does, freezes for about 1 or 2 seconds...

@wtubog for all files or only JS files?

I have exactly same issue with golang project and watcherService taking 100% of CPU and constantly raising memory usage over time.

Edit: Well, not _exactly_ same but issue with ram consumption.
Running Ubuntu 17.10 64 bit.
I guess issues can be related to huge vendor folder.

Getting same issue with VsCode 1.20.1

My memory consumption rise upto 2.5 gb when ts compiles to js, using gulp-typescript. And normally in idle mode its about 1.5 - 1.8 Gb. High memory consumption also impairs intellisense and type support.

Attaching output from code --status:

image

image

same issue memory consumption is at 2.6GB for vscode, im building and running a react app

same issue with VsCode 1.22.1

Attaching output from code --status:

Getting same behavior with 1.22.2. At the beginning of the day, fresh start, its using 233Mb. Yesterday at around noon and after noon for some reason I had to restart the app multiple times it was reaching a 2Gb of memory usage. Only had a few ansible files open, and files are not super large. My extensions were all active though. Will test again today.

I'm getting the same behavior with Visual Studio Code 1.22.2
It seems to happen around the time when I resize the built-in terminal.

VSCode going haywire:
9gb

Here's the performance meter before/after killing the process.
kill vscode

Yes, It is consuming too much memory

Yes, It is consuming too much memory

All extensions disabled 1.22.2 is eating 800mb to a gig at idle for me. Is that normal? Could well be as I've only just started using Code so I'm not being sarcastic just genuinely curious as this is unusable on my admittedly badly resourced PC. Just seems high fora gloried text editor :(

I switched to emacs and I am loving it.

This is turning into a deal breaker, freezes my vm, ram just goes ballistic, vs code team do this: open vs code and let it run for 8h straight and see how it gobbles up ram

Still happening, Insider version eats upto 1gb of ram without doing much, I hardly use any plugins and It makes a lot of threads when it starts up and that's not how I/O should be done as Ryan Dahl said.

VS Code is too slow and consuming too much memory, I gave up and go back to Sublime/VIM.

this my first post ever on here ....i thot i had to find out what going on....i got an update notification so i updated it ...it has slowed down a lot and i was not doing much just html/css stuff...checked task manager it was sucking up 700mb ..was never like this before update. ....kinda sucks was working really smooth before update ...hope it get figured out...i do like vs code a lot....just checked memory usage ...having vs code just open is piling it up over 400mb of mem...ouch.

Same issue, about 3 or 4 Code Helper processes are running on mac and taking 1gb memory each

I have build 1.23.1 running on Ubuntu 18.04 and have the same issue as everyone else here ... huge RAM usage, in my case 1.5GB. When I run code --status, I see the culprit is extensionHost. Running without extensions seems to make the problem go away, but of course I NEED those extensions.

If I run for more than an hour or two my entire system will freeze and I'll have to reboot.

This is a real problem, needless to say.

@bpasero any debug traces we can do to help?

The best is to verify the memory consumption is high due to an extension and then disable extensions one by one to find the offender. Then, file a bug against the extension with steps if possible and update this issue so that others can see if they have the same extension installed.

+1

We do not have any extra extension installed, the VS CODE is eating a lot memory, apparently it's mainly because the .net behind.

This was in my way so I dug in, and the offending extension seems to be "Import Cost" from Wix. I had it installed as part of the vscode for node.js development pack. Had a lot of extensions and of course it was almost the LAST one I tried. Doh!

Can anyone confirm?

screenshot 1

I am also experiencing the same issue of ram and cpu usage when i am not doing any text editing and coding.

I t was great before all the updates. I am experiencing the same problem.

For those of you still experiencing problems, I recommend you see whether it is an extension that is causing the problem, because if so you're not going to see any relief waiting for a bug fix from the core vscode updates. Check your output of code --status (see posts above) and see if there are multiple processes for extensionHost, one of which is huge.

In my case uninstalling the "Import Cost" extension that is part of the popular vscode for node.js development pack fixed the problem, and I have been running well for 5 days now. I have reported the problem to the maintainers of Import Cost, btw.

If that doesn't help, the problem may be the file watching and indexing. Does the RAM usage get really bad when you first open a project, but then settles down after a few minutes? There is a user/workspace setting called _files.watcherExclude_ that has helped me in the past. Read up on that setting.

Good luck!

update: forgot to mention _files.exclude_ and _search.exclude settings_. Read up on those settings as well.

For me, it's git. I've done a lot of changes [over 5k], and VSCode's in-built git uses 600-700 MB of memory when it's running in background. I'm really, really frustrated.

I had same problem (explosive RAM/CPU usage) too on Fedora 26, but throwing all big folders (vendor, tmp, dist, etc.) in our project to "files.watcherExclude" solved it (for now).

can you guys share your user / workspace settings that helped you?

Linux 3.10.0-693.el7.x86_64 (CentOS)
VSCode spent all RAM and gave next text in console:
[Error - 09:19:36] Request textDocument/codeAction failed. Error: Connection got disposed. at Object.dispose (/home/pokat/.vscode/extensions/ms-vscode.cpptools-0.17.6/node_modules/vscode-jsonrpc/lib/main.js:825:25) at Object.dispose (/home/pokat/.vscode/extensions/ms-vscode.cpptools-0.17.6/node_modules/vscode-languageclient/lib/client.js:57:35) at LanguageClient.handleConnectionClosed (/home/pokat/.vscode/extensions/ms-vscode.cpptools-0.17.6/node_modules/vscode-languageclient/lib/client.js:1864:38) at LanguageClient.handleConnectionClosed (/home/pokat/.vscode/extensions/ms-vscode.cpptools-0.17.6/node_modules/vscode-languageclient/lib/main.js:106:15) at closeHandler (/home/pokat/.vscode/extensions/ms-vscode.cpptools-0.17.6/node_modules/vscode-languageclient/lib/client.js:1852:18) at CallbackList.invoke (/home/pokat/.vscode/extensions/ms-vscode.cpptools-0.17.6/node_modules/vscode-jsonrpc/lib/events.js:71:39) at Emitter.fire (/home/pokat/.vscode/extensions/ms-vscode.cpptools-0.17.6/node_modules/vscode-jsonrpc/lib/events.js:135:36) at closeHandler (/home/pokat/.vscode/extensions/ms-vscode.cpptools-0.17.6/node_modules/vscode-jsonrpc/lib/main.js:221:26) at CallbackList.invoke (/home/pokat/.vscode/extensions/ms-vscode.cpptools-0.17.6/node_modules/vscode-jsonrpc/lib/events.js:71:39) at Emitter.fire (/home/pokat/.vscode/extensions/ms-vscode.cpptools-0.17.6/node_modules/vscode-jsonrpc/lib/events.js:135:36) at StreamMessageReader.AbstractMessageReader.fireClose (/home/pokat/.vscode/extensions/ms-vscode.cpptools-0.17.6/node_modules/vscode-jsonrpc/lib/messageReader.js:135:27) at Socket.<anonymous> (/home/pokat/.vscode/extensions/ms-vscode.cpptools-0.17.6/node_modules/vscode-jsonrpc/lib/messageReader.js:188:62) at emitOne (events.js:101:20) at Socket.emit (events.js:191:7) at Pipe._handle.close [as _onclose] (net.js:510:12) [Error - 09:19:36] Request textDocument/codeAction failed. Error: Connection got disposed. at Object.dispose (/home/pokat/.vscode/extensions/ms-vscode.cpptools-0.17.6/node_modules/vscode-jsonrpc/lib/main.js:825:25) at Object.dispose (/home/pokat/.vscode/extensions/ms-vscode.cpptools-0.17.6/node_modules/vscode-languageclient/lib/client.js:57:35) at LanguageClient.handleConnectionClosed (/home/pokat/.vscode/extensions/ms-vscode.cpptools-0.17.6/node_modules/vscode-languageclient/lib/client.js:1864:38) at LanguageClient.handleConnectionClosed (/home/pokat/.vscode/extensions/ms-vscode.cpptools-0.17.6/node_modules/vscode-languageclient/lib/main.js:106:15) at closeHandler (/home/pokat/.vscode/extensions/ms-vscode.cpptools-0.17.6/node_modules/vscode-languageclient/lib/client.js:1852:18) at CallbackList.invoke (/home/pokat/.vscode/extensions/ms-vscode.cpptools-0.17.6/node_modules/vscode-jsonrpc/lib/events.js:71:39) at Emitter.fire (/home/pokat/.vscode/extensions/ms-vscode.cpptools-0.17.6/node_modules/vscode-jsonrpc/lib/events.js:135:36) at closeHandler (/home/pokat/.vscode/extensions/ms-vscode.cpptools-0.17.6/node_modules/vscode-jsonrpc/lib/main.js:221:26) at CallbackList.invoke (/home/pokat/.vscode/extensions/ms-vscode.cpptools-0.17.6/node_modules/vscode-jsonrpc/lib/events.js:71:39) at Emitter.fire (/home/pokat/.vscode/extensions/ms-vscode.cpptools-0.17.6/node_modules/vscode-jsonrpc/lib/events.js:135:36) at StreamMessageReader.AbstractMessageReader.fireClose (/home/pokat/.vscode/extensions/ms-vscode.cpptools-0.17.6/node_modules/vscode-jsonrpc/lib/messageReader.js:135:27) at Socket.<anonymous> (/home/pokat/.vscode/extensions/ms-vscode.cpptools-0.17.6/node_modules/vscode-jsonrpc/lib/messageReader.js:188:62) at emitOne (events.js:101:20) at Socket.emit (events.js:191:7) at Pipe._handle.close [as _onclose] (net.js:510:12) [Error - 09:19:36] Request textDocument/codeAction failed. Error: Connection got disposed. at Object.dispose (/home/pokat/.vscode/extensions/ms-vscode.cpptools-0.17.6/node_modules/vscode-jsonrpc/lib/main.js:825:25) at Object.dispose (/home/pokat/.vscode/extensions/ms-vscode.cpptools-0.17.6/node_modules/vscode-languageclient/lib/client.js:57:35) at LanguageClient.handleConnectionClosed (/home/pokat/.vscode/extensions/ms-vscode.cpptools-0.17.6/node_modules/vscode-languageclient/lib/client.js:1864:38) at LanguageClient.handleConnectionClosed (/home/pokat/.vscode/extensions/ms-vscode.cpptools-0.17.6/node_modules/vscode-languageclient/lib/main.js:106:15) at closeHandler (/home/pokat/.vscode/extensions/ms-vscode.cpptools-0.17.6/node_modules/vscode-languageclient/lib/client.js:1852:18) at CallbackList.invoke (/home/pokat/.vscode/extensions/ms-vscode.cpptools-0.17.6/node_modules/vscode-jsonrpc/lib/events.js:71:39) at Emitter.fire (/home/pokat/.vscode/extensions/ms-vscode.cpptools-0.17.6/node_modules/vscode-jsonrpc/lib/events.js:135:36) at closeHandler (/home/pokat/.vscode/extensions/ms-vscode.cpptools-0.17.6/node_modules/vscode-jsonrpc/lib/main.js:221:26) at CallbackList.invoke (/home/pokat/.vscode/extensions/ms-vscode.cpptools-0.17.6/node_modules/vscode-jsonrpc/lib/events.js:71:39) at Emitter.fire (/home/pokat/.vscode/extensions/ms-vscode.cpptools-0.17.6/node_modules/vscode-jsonrpc/lib/events.js:135:36) at StreamMessageReader.AbstractMessageReader.fireClose (/home/pokat/.vscode/extensions/ms-vscode.cpptools-0.17.6/node_modules/vscode-jsonrpc/lib/messageReader.js:135:27) at Socket.<anonymous> (/home/pokat/.vscode/extensions/ms-vscode.cpptools-0.17.6/node_modules/vscode-jsonrpc/lib/messageReader.js:188:62) at emitOne (events.js:101:20) at Socket.emit (events.js:191:7) at Pipe._handle.close [as _onclose] (net.js:510:12)

settings:

{
"workbench.colorTheme": "Visual Studio Light",
//"clang-format.fallbackStyle": "LLVM",
"clang-format.style": "file",
"clang-format.executable": "/opt/llvm-3.9.0/bin/clang-format",
"editor.formatOnSave": false,
"window.restoreWindows": "all",
"window.zoomLevel": 0,
"workbench.colorCustomizations": {
"editorIndentGuide.activeBackground": "#ff0000"
}
}

Same issue, it suddenly started to consume 14 GB of RAM and up to 40% load on an Nvidia Quadro, cool...
The only thing I do is load a project.

My MacBook Pro has been going up and down like a yoyo the last couple of days. I installed, uninstalled and reinstalled extensions and all sorts with no success!

the above disappoints me but the way in which @bpasero was replying to the initial chap who opened this issue annoyed me even more. I mean is it me or is he just being short / rude until everyone else who has this issue starts chipping in?

in the market for a new text editor for creating react applications if anyone has any suggestions?

I actually downloaded Atom for when this happens again, it stopped for now, without me doing anything

after last updates, i saw new bug:
vscode stuck about 5 minutes and after this gave output:

[Error - 10:57:05] Request textDocument/codeAction failed. Error: Connection got disposed. at Object.dispose (/home/pokat/.vscode/extensions/ms-vscode.cpptools-0.17.6/node_modules/vscode-jsonrpc/lib/main.js:825:25) at Object.dispose (/home/pokat/.vscode/extensions/ms-vscode.cpptools-0.17.6/node_modules/vscode-languageclient/lib/client.js:57:35) at LanguageClient.handleConnectionClosed (/home/pokat/.vscode/extensions/ms-vscode.cpptools-0.17.6/node_modules/vscode-languageclient/lib/client.js:1864:38) at LanguageClient.handleConnectionClosed (/home/pokat/.vscode/extensions/ms-vscode.cpptools-0.17.6/node_modules/vscode-languageclient/lib/main.js:106:15) at closeHandler (/home/pokat/.vscode/extensions/ms-vscode.cpptools-0.17.6/node_modules/vscode-languageclient/lib/client.js:1852:18) at CallbackList.invoke (/home/pokat/.vscode/extensions/ms-vscode.cpptools-0.17.6/node_modules/vscode-jsonrpc/lib/events.js:71:39) at Emitter.fire (/home/pokat/.vscode/extensions/ms-vscode.cpptools-0.17.6/node_modules/vscode-jsonrpc/lib/events.js:135:36) at closeHandler (/home/pokat/.vscode/extensions/ms-vscode.cpptools-0.17.6/node_modules/vscode-jsonrpc/lib/main.js:221:26) at CallbackList.invoke (/home/pokat/.vscode/extensions/ms-vscode.cpptools-0.17.6/node_modules/vscode-jsonrpc/lib/events.js:71:39) at Emitter.fire (/home/pokat/.vscode/extensions/ms-vscode.cpptools-0.17.6/node_modules/vscode-jsonrpc/lib/events.js:135:36) at StreamMessageWriter.AbstractMessageWriter.fireClose (/home/pokat/.vscode/extensions/ms-vscode.cpptools-0.17.6/node_modules/vscode-jsonrpc/lib/messageWriter.js:57:27) at Socket.<anonymous> (/home/pokat/.vscode/extensions/ms-vscode.cpptools-0.17.6/node_modules/vscode-jsonrpc/lib/messageWriter.js:79:63) at emitOne (events.js:96:13) at Socket.emit (events.js:191:7) at Pipe._handle.close [as _onclose] (net.js:510:12)

When I open my PHP project(Yii2 framework) in win10, it takes up too much memory.

1
2
3
4

Thanks, @TerminatorP! That worked!

capture
Same here

Thanks @billybarnum, it seems, Import Cost extension is memory hungry.

Cheers

I removed all my extensions and it still caused problems, randomly.

I think the issue is relate to the IntelliSense Updatings, i have the same issue when i open a Stored Procedure File and connect it to a DB using MS SQL extension the memory goes up. I replicated this issue using MSQL Management Studio.
image

image

I think there are bugs with the integrated console, for me it goes nuts when I run a command to some custom test with some custom test framework inside the integrated terminal. It becomes unresponsive and I have to kill VS. When I open a separate terminal it doesn't do this, just in VS Code randomly. This is so sad, VS and VS Code were the only Microsoft software that ran very well (in my experience), now that's gone too. RIP

Am running VS code 1.25.1 on Ubuntu 16.04 and everything seems to be okay here. Just open a Laravel application. I don't have very many extensions just Vetur for vue files, Laravel blade snippets with highlighting by Winnie lin and php namespace resolver.

Here is a screenshot of the memory usage.

vs-c6de

The version
vs-code-version

Have also open two integrated terminal tabs one running php artisan serve and another running npm run watch

1.25.1 on Win 10 1709 here. 58 enabled extensions. added
"**/*/**": true

to files.watcherExclude.

Freshly opened with no files in editor, I'm sitting at around 400M idle.

With a simple text file open and the user settings tab open, i'm at 445M.

Open up a .ps1 file and the command prompt opens up, 750M

Close all open files console stays open until manually killed to recover 100M.

Overall, not horrible for my use case. Better than the *other electron based editor, but still really heavy.

Mine consuming 3gb+ of memory any solution?

Same for me with the latest update on mac code helper get around 2gb of memory

Hello Guys, i was have the problem and after search here, i think the problem is installing a big number of extensions.
After i deleted unnecessary VS Code become faster and consume less RAM

Same Problem here, originally used Code because it was light. Guess it is time to switch....

Had the same problem, had to disable CSS Peek extension

Version: 1.26.0-insider
Commit: aceb8771b1c0e116f684091986ad25769bdc0537
Date: 2018-08-07T07:55:29.593Z
Electron: 2.0.5
Chrome: 61.0.3163.100
Node.js: 8.9.3
V8: 6.1.534.41
Architecture: x64

Hitting high memory issues even without any enabled extension, and finally vscode hangs. Looks like it's related to the integrated terminal in my case.

I'm using 1.25.1, and the simplest repro was:

  1. code --disable-extensions
  2. Open and edit files - everything is fine so far, including RAM.
  3. View -> Integrated Terminal
  4. Type something in the integrated terminal -> RAM spikes to over 1Gb, and vscode isn't responsive anymore.

Thanks!

@boaz-chen that is exactly what I nailed it down to also, if you check my comment above. The flow that you did happens to me too, but not every time. I just pull out the console to do something and puff goes VSCode....

I bet for one dollar that this problem won't be fixed this year.(may even get worse)

I haven't had issues since my previous comment (around 2 weeks)

I download vscode insider and it works fine for now.

Still not fixed. Using up 7 GB out of 16 when idle.

Guess it's time to ditch it and move on to Atom or something.

I am closing this meta issue and ask people to report individual issues with steps how to reproduce and after following our guide at: https://github.com/Microsoft/vscode/wiki/Performance-Issues

Thanks

I am also having the same issue and I need extensions too.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

biij5698 picture biij5698  Â·  3Comments

philipgiuliani picture philipgiuliani  Â·  3Comments

VitorLuizC picture VitorLuizC  Â·  3Comments

sijad picture sijad  Â·  3Comments

trstringer picture trstringer  Â·  3Comments