microsoft/vscode

High CPU load on single-CPU VM

hgotur opened this issue ยท 25 comments

  • VSCode Version: 1.7.2
  • OS Version: Windows Server 2012 R2

Steps to Reproduce:

  1. Install VS Code
  2. Launch VS Code

I tried uninstall and reinstall and it still happens. I open VS Code, and the CPU usage goes up. It goes back down after a few seconds, but shoots back up again. This is despite not opening any files or doing anything on VS Code.

@hgotur Do you see any errors in the dev console? Command Palette > Developer: Toggle Developer Tools. Also, can you pls go to Command Palette > Help: Report Issue and copy the list of extensions in the pre-populated issue into this one?

Also, please use process explorer and provide the full list of arguments of the process going crazy

Exact same problem here. Basically a brand new 2012 R2 VM install on VMWare. 2GB RAM. Brand new install of vscode, with no plugins.

It's practically impossible to use. It takes 30+ seconds for the window to even appear after clicking the icon to launch the application. Don't know if it'll ever come up enough for me to get to the command palette.

I am using the latest insiders build. "code - insiders.exe" is consuming the CPU.

image

image

Hope that helps.

We have heard reports and can reproduce of VS Code running very slow on VMs when they are configured with 1 CPU.

@bpasero It does only have one CPU. I'll fiddle some knobs when I get back from vacation and see if it fixes the problem.

  • Extensions:
Extension Author Version
cpptools ms-vscode 0.8.1
csharp ms-vscode 1.3.0

These are the extensions. There were no errors in the dev console. My configuration is also a VM with one CPU.

I am also facing the exact same issue on a vm with single core cpu and 2 gb ram. Works pretty cool on my local dual core pc.
Fresh install of VS, No extensions installed.

capture

Same issue here with version 1.8, single core CPU is maxed out. Fresh install, no extensions.

Any known workarounds? Would using an earlier version help? Is this a VS Code issue or Electron?

Update: Found the following issue on SO which could indicate OS ver could be an issue. I'm also using Windows Server 2012 R2 which should be the same codebase as Windows 8.1 which is noted as not affected.

Also see electron/electron#7839. Should this be mentioned in release notes as a known issue?

vov32 commented

I have same issue on core i7. It is not VM.

  • VSCode Version: Code 1.10.1 (653f8733dd5a5c43d66d7168b4701f94d72b62e5, 2017-03-02T00:47:58.633Z)
  • OS Version: Linux x64 4.9.9-1-MANJARO
  • CPUs: Intel(R) Core(TM) i7-2630QM CPU @ 2.00GHz (8 x 2599)
  • Memory (System): 9.63GB (6.10GB free)
  • Memory (Process): 173.82MB working set (211.97MB peak, 99.30MB private, 74.53MB shared)
  • Load (avg): 2, 1, 1
  • VM: 0%
  • Initial Startup: yes
  • Screen Reader: no
  • Empty Workspace: no
  • Timings:
Component Task Time (ms)
main start => app.isReady 58
main app.isReady => window.loadUrl() 408
renderer window.loadUrl() => begin to require(workbench.main.js) 313
renderer require(workbench.main.js) 1660
renderer create extension host => extensions onReady() 783
renderer restore viewlet 1084
renderer restore editor view state 1
renderer overall workbench load 1399
main + renderer start => extensions ready 3347
main + renderer start => workbench ready 3875

Same here. 100% cpu just from opening vscode. no extensions,
Brand new Azure Windows Server 2012 R2 - 1 cpu
Fresh install of vscode 1.10.1

CONFIRMED SOLUTION -- We added another core to our existing VM and the CPU issues disappeared for both Visual Studio Code and Atom (Both of which rely on Electron). At this point I believe this is actually electron issue electron/electron#7839.

Closing this as question. Our application model highly depends on multiple process. This isn't fit single core machines well but we also believe that's a problem of VMs. Single core hardware should be very rare these days.

Rare, like my brand new Raspberry PI Zero W? Sorry, I get it. But it's frustrating. I love VS Code.

@jrieken How about adding the need for multiple cores in release notes and VS Code requirements?

cc @gregvanl for the comment above

IMHO this should be fix/improved. Code is a good tool to edit files on the fly and should be a proper lightweight alternative to the big IDE's. For me this is the exact solution where i would use Code instead of any other IDE/Editor, systems with low resources and I don't want to install VS(or any other IDE), code is fast and easy to install and gives me just what i need for debugging and some quick editing of my source files.

IMNSHO at the very least, VisualStudioCode should detect that it's running on a single-core and give an error to the user at launch time, informing him about this limitation, otherwise the UX is quite ludicrous.

@jrieken Problem still reproduced on version 1.13
For client, yes, for server and VM, no. More cores means more money and waste of computing resources.
So you may think it wont be used on server or VMs?

I am getting this issue on Hyper-V single CPU VM.

CPU is pegged at 100% just starting up Code and stays pegged. The OS is unusable.

I do not understand how this issue is closed. This is not a case of "VS Code is a resource intensive app, you can't expect it to run well on a single core VM!!".

There appears to be some horrible degenerate bug here.

Version 1.5.2 takes a minute to launch but otherwise works well on single core machines.

@m-brian Thanks, confirmed that version from August 2016 works. Also, there is now an insiders build for a new 64 bit version which might be worth trying.

Version 1.15.1, clean installation without extensions in a single hyper-v VM Windows Server 2012 R2 (6.3.9600) 100% cpu. Upgraded to 2 cpu and VS Code starts up without any problem

Same problem as today September 13, 2017. Just installed latest version and never have been able to start it. The VM CPU goes to 99% and becomes unresponsive. Fresh install, no extensions..
image
And is starting 4 different threads. Does not make sense. I have installed it just to use it for getting source code from TFS without installing a full VS . Thx, but NO thx.

@costica-moldovanu AFAIK the single core CPU issue isn't VS Code per se, but rather the underlying use of Electron. As for TFS, you can also use the TFS CLI.