microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.24k stars 28.56k forks source link

High CPU usage, no plugins enabled #73883

Closed prk3 closed 5 years ago

prk3 commented 5 years ago

Issue Type: Performance Issue

VS code consumes 10-20% of my CPU even when I don't do anything in it. No extensions enabled. Sometimes the usage rises just after start, sometimes I have to wait for a few hours before it happens. Periodic RAM usage spikes are probably related. I'm on Fedora 29, KDE.

VS Code version: Code 1.33.1 (51b0b28134d51361cf996d2f0a1c698247aeabd8, 2019-04-11T08:20:22.771Z) OS version: Linux x64 5.0.10-200.fc29.x86_64

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz (8 x 2700)| |GPU Status|2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: disabled_software
surface_synchronization: enabled_on
video_decode: unavailable_off
webgl: enabled
webgl2: enabled| |Load (avg)|3, 3, 2| |Memory (System)|15.46GB (1.03GB free)| |Process Argv|--unity-launch| |Screen Reader|no| |VM|0%|
Process Info ``` CPU % Mem MB PID Process 0 127 24858 code main 0 32 24860 zygote 0 269 24948 window (● cards.ts - micro (Workspace) - Visual Studio Code) 0 111 25019 extensionHost 0 47 25458 /usr/share/code/code /usr/share/code/resources/app/extensions/json-language-features/server/dist/jsonServerMain --node-ipc --clientProcessId=25019 0 63 25040 watcherService 0 111 25140 shared-process 0 95 30741 window (Issue Reporter) 0 79 24932 gpu-process 0 0 30857 /bin/ps -ax -o pid=,ppid=,pcpu=,pmem=,command= ```
Workspace Info ``` | Window (● cards.ts - micro (Workspace) - Visual Studio Code) | Folder (service-upload): 197 files | File types: js(70) svg(23) jpg(19) mp4(18) jpeg(18) png(14) ogv(9) | mp3(4) JPG(3) json(3) | Conf files: package.json(1) settings.json(1) | Folder (ovos-play): more than 22396 files | File types: js(9174) map(8987) json(3109) gzip(529) ts(219) tsx(45) | md(40) less(36) jsx(25) css(16) | Conf files: package.json(13) tsconfig.json(9) tslint.json(6) | settings.json(2) gulp.js(1); ```

Extensions: none

image image image

prk3 commented 5 years ago

Update: I noticed that if I hover over some variable (in typescript file), the first line of the popup flickers as if the types were being recalculated every second. youtube demo

mjbvz commented 5 years ago

Does this reproduce in the latest VS Code insiders build with all extensions disabled?

Also, please follow these instructions to collect performance information. Share the output of code-insiders --status when the problem occurs

prk3 commented 5 years ago

Insiders version (no extensions, default config) worked ok for 2 days, but now a similar thing happens. Here is the output of code-insiders --status:

1

[3410:0524/141541.570340:ERROR:sandbox_linux.cc(379)] InitializeSandbox() called with multiple threads in process gpu-process.
Version:          Code - Insiders 1.35.0-insider (4ca38ce5584d7cd67b435b3c32ef1240c6a29628, 2019-05-21T05:15:14.763Z)
OS Version:       Linux x64 5.0.16-300.fc30.x86_64
CPUs:             Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz (8 x 2993)
Memory (System):  15.46GB (0.70GB free)
Load (avg):       4, 3, 3
VM:               0%
Screen Reader:    no
Process Argv:     --unity-launch
GPU Status:       2d_canvas:                    enabled
                  checker_imaging:              disabled_off
                  flash_3d:                     enabled
                  flash_stage3d:                enabled
                  flash_stage3d_baseline:       enabled
                  gpu_compositing:              enabled
                  multiple_raster_threads:      enabled_on
                  native_gpu_memory_buffers:    disabled_software
                  rasterization:                disabled_software
                  surface_synchronization:      enabled_on
                  video_decode:                 unavailable_off
                  webgl:                        enabled
                  webgl2:                       enabled

CPU %   Mem MB     PID  Process
    0      111    4193  code-insiders main
    0       32    4195     zygote
    0      586    4241       window (● NewsTypeSelect.tsx - micro (Workspace) - Visual Studio Code - Insiders)
    0      380    4293         extensionHost
   13     1472    4332           electron_node tsserver.js
    0       63    4368             electron_node typingsInstaller.js typesMap.js
    0       47    4420           /usr/share/code-insiders/code-insiders /usr/share/code-insiders/resources/app/extensions/json-language-features/server/dist/jsonServerMain --node-ipc --clientProcessId=4293
    0       95    4506           /usr/share/code-insiders/code-insiders /usr/share/code-insiders/resources/app/extensions/html-language-features/server/dist/htmlServerMain --node-ipc --clientProcessId=4293
    0       63    4312         watcherService
    0       79    4369       shared-process
    0       63    4226     gpu-process

Workspace Stats:
|  Window (● NewsTypeSelect.tsx - micro (Workspace) - Visual Studio Code - Insiders)
|    Folder (ovos-play): more than 23096 files
|      File types: js(9339) map(9138) json(3237) gzip(529) ts(332) tsx(91)
|                  png(86) less(59) md(40) jsx(25)
|      Conf files: package.json(13) tsconfig.json(9) tslint.json(6)
|                  settings.json(2) gulp.js(1)
|    Folder (service-upload): 197 files
|      File types: js(70) svg(23) jpg(19) mp4(18) jpeg(18) png(14) ogv(9)
|                  mp3(4) JPG(3) json(3)
|      Conf files: package.json(1) settings.json(1)
2

[3550:0524/141633.594040:ERROR:sandbox_linux.cc(379)] InitializeSandbox() called with multiple threads in process gpu-process.
Version:          Code - Insiders 1.35.0-insider (4ca38ce5584d7cd67b435b3c32ef1240c6a29628, 2019-05-21T05:15:14.763Z)
OS Version:       Linux x64 5.0.16-300.fc30.x86_64
CPUs:             Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz (8 x 3195)
Memory (System):  15.46GB (0.29GB free)
Load (avg):       3, 3, 3
VM:               0%
Screen Reader:    no
Process Argv:     --unity-launch
GPU Status:       2d_canvas:                    enabled
                  checker_imaging:              disabled_off
                  flash_3d:                     enabled
                  flash_stage3d:                enabled
                  flash_stage3d_baseline:       enabled
                  gpu_compositing:              enabled
                  multiple_raster_threads:      enabled_on
                  native_gpu_memory_buffers:    disabled_software
                  rasterization:                disabled_software
                  surface_synchronization:      enabled_on
                  video_decode:                 unavailable_off
                  webgl:                        enabled
                  webgl2:                       enabled

CPU %   Mem MB     PID  Process
    0      111    4193  code-insiders main
    0       32    4195     zygote
    1      586    4241       window (● NewsTypeSelect.tsx - micro (Workspace) - Visual Studio Code - Insiders)
    0      380    4293         extensionHost
   13     1599    4332           electron_node tsserver.js
    0       63    4368             electron_node typingsInstaller.js typesMap.js
    0       47    4420           /usr/share/code-insiders/code-insiders /usr/share/code-insiders/resources/app/extensions/json-language-features/server/dist/jsonServerMain --node-ipc --clientProcessId=4293
    0       95    4506           /usr/share/code-insiders/code-insiders /usr/share/code-insiders/resources/app/extensions/html-language-features/server/dist/htmlServerMain --node-ipc --clientProcessId=4293
    0       63    4312         watcherService
    0       79    4369       shared-process
    0       63    4226     gpu-process

Workspace Stats:
|  Window (● NewsTypeSelect.tsx - micro (Workspace) - Visual Studio Code - Insiders)
|    Folder (service-upload): 197 files
|      File types: js(70) svg(23) jpg(19) mp4(18) jpeg(18) png(14) ogv(9)
|                  mp3(4) JPG(3) json(3)
|      Conf files: package.json(1) settings.json(1)
|    Folder (ovos-play): more than 22917 files
|      File types: js(9338) map(9138) json(3237) gzip(529) ts(225) png(85)
|                  tsx(46) md(40) less(36) jsx(25)
|      Conf files: package.json(13) tsconfig.json(9) tslint.json(6)
|                  settings.json(2) gulp.js(1)
3

[3673:0524/141641.416435:ERROR:sandbox_linux.cc(379)] InitializeSandbox() called with multiple threads in process gpu-process.
Version:          Code - Insiders 1.35.0-insider (4ca38ce5584d7cd67b435b3c32ef1240c6a29628, 2019-05-21T05:15:14.763Z)
OS Version:       Linux x64 5.0.16-300.fc30.x86_64
CPUs:             Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz (8 x 2873)
Memory (System):  15.46GB (0.46GB free)
Load (avg):       3, 3, 3
VM:               0%
Screen Reader:    no
Process Argv:     --unity-launch
GPU Status:       2d_canvas:                    enabled
                  checker_imaging:              disabled_off
                  flash_3d:                     enabled
                  flash_stage3d:                enabled
                  flash_stage3d_baseline:       enabled
                  gpu_compositing:              enabled
                  multiple_raster_threads:      enabled_on
                  native_gpu_memory_buffers:    disabled_software
                  rasterization:                disabled_software
                  surface_synchronization:      enabled_on
                  video_decode:                 unavailable_off
                  webgl:                        enabled
                  webgl2:                       enabled

CPU %   Mem MB     PID  Process
    0      111    4193  code-insiders main
    0       32    4195     zygote
    1      586    4241       window (● NewsTypeSelect.tsx - micro (Workspace) - Visual Studio Code - Insiders)
    0      380    4293         extensionHost
   12     1441    4332           electron_node tsserver.js
    0       63    4368             electron_node typingsInstaller.js typesMap.js
    0       47    4420           /usr/share/code-insiders/code-insiders /usr/share/code-insiders/resources/app/extensions/json-language-features/server/dist/jsonServerMain --node-ipc --clientProcessId=4293
    0       95    4506           /usr/share/code-insiders/code-insiders /usr/share/code-insiders/resources/app/extensions/html-language-features/server/dist/htmlServerMain --node-ipc --clientProcessId=4293
    0       63    4312         watcherService
    0       79    4369       shared-process
    0       63    4226     gpu-process

Workspace Stats:
|  Window (● NewsTypeSelect.tsx - micro (Workspace) - Visual Studio Code - Insiders)
|    Folder (service-upload): 197 files
|      File types: js(70) svg(23) jpg(19) mp4(18) jpeg(18) png(14) ogv(9)
|                  mp3(4) JPG(3) json(3)
|      Conf files: package.json(1) settings.json(1)
|    Folder (ovos-play): more than 23083 files
|      File types: js(9338) map(9138) json(3237) gzip(529) ts(328) tsx(88)
|                  png(85) less(57) md(40) jsx(25)
|      Conf files: package.json(13) tsconfig.json(9) tslint.json(6)
|                  settings.json(2) gulp.js(1)
mjbvz commented 5 years ago

@prk3 So you see ~10% while not doing anything in the editor? Does this ever stop or is it consistently there?

prk3 commented 5 years ago

@mjbvz Yes. It's 13% to be exact (which is 1 thread running at 100%). If I don't touch the editor it stays like this forever. It sometimes stops after a while of coding, but it's very random.

mjbvz commented 5 years ago

Can you please try checking the TS Server log:

  1. Set "typescript.tsserver.log": "verbose",
  2. Restart VS Code and reproduce the problem
  3. In VS Code, run the TypeScript: Open TS Server log command
  4. This should open a tsserver.log file in the editor,

If you can share the log, I can also take a look to see if anything stands out. Specifically, check at the end of the logs to see if there are repeated requests being made

⚠️Warning: The TypeScript log may include information from your workspace, including file paths and source code. If you have any concerns about posting this publicly on Github, just let me know and we can arrange something else. On our side, we only use these logs to investigate issues like this

vscodebot[bot] commented 5 years ago

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!