Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Continual CPU usage from typingsInstaller process #36950

Closed
mowagih96 opened this issue Feb 19, 2020 · 17 comments
Closed

Continual CPU usage from typingsInstaller process #36950

mowagih96 opened this issue Feb 19, 2020 · 17 comments
Assignees
Labels
Duplicate An existing issue was already created Needs Investigation This issue needs a team member to investigate its status.

Comments

@mowagih96
Copy link

  • VSCode Version: 1.42.1
  • OS Version: Ubuntu 18.04.4 LTS

Steps to Reproduce:

  1. Launch VSCode.
  2. Enable Typescript and Javascript language features extension.

Does this issue occur when all extensions are disabled?:

No, As a matter of fact I disabled all the built-in extensions except Typescript and Javascript language features extension and the problem remains untacked but if I disabled it no more loud fans nor overheat.
Also, I tried the code --status command mentioned here and I found that extensionHost is listed in the output and as they stated

When the process listing in the Process Explorer or the output of code --status shows that the extensionHost is consuming a high percentage of CPU then this is likely caused by an extension.

Finally, I monitored the CPU usage % while running VSCode with and without the mentioned extension I found the following:

  • When the extension is disabled: 0%
  • When the extension is enabled: Starts at 30% to 28% to 16% then keeps bouncing between 16% and 9%.

This issue overheats my laptop and I think that was not intended I mean why only this extension is causing me issues while the others are not? and no I can't just disable it and move on because I need it. The whole point of me using VSCode is this feature.

*P.S: I tried clean install and disabled gpu acceleration nothing worked.

@mjbvz
Copy link
Contributor

mjbvz commented Feb 19, 2020

Can you share the output of code --status

Also, does this reproduce in the latest VS Code insiders build?

@mowagih96
Copy link
Author

mowagih96 commented Feb 20, 2020

Can you share the output of code --status

Version:          Code 1.42.1 (c47d83b293181d9be64f27ff093689e8e7aed054, 2020-02-11T14:50:36.977Z)
OS Version:       Linux x64 4.15.0-88-generic
CPUs:             Intel(R) Core(TM) i7-5500U CPU @ 2.40GHz (4 x 2770)
Memory (System):  7.71GB (2.04GB free)
Load (avg):       3, 2, 1
VM:               0%
Screen Reader:    no
Process Argv:     --disable-gpu --unity-launch
GPU Status:       2d_canvas:                     unavailable_software
                  flash_3d:                      disabled_software
                  flash_stage3d:                 disabled_software
                  flash_stage3d_baseline:        disabled_software
                  gpu_compositing:               disabled_software
                  metal:                         disabled_off
                  multiple_raster_threads:       enabled_on
                  oop_rasterization:             disabled_off
                  protected_video_decode:        disabled_off
                  rasterization:                 disabled_software
                  skia_renderer:                 disabled_off
                  surface_control:               disabled_off
                  surface_synchronization:       enabled_on
                  video_decode:                  disabled_software
                  viz_display_compositor:        enabled_on
                  viz_hit_test_surface_layer:    disabled_off
                  webgl:                         unavailable_software
                  webgl2:                        unavailable_software

CPU %	Mem MB	   PID	Process
    0	   134	  9036	code main
    0	    32	  9040	   zygote
    0	     8	  9042	     zygote
    0	    79	  9066	   gpu-process
    0	     8	  9074	     broker
    0	   110	  9148	   shared-process
    0	     0	  9372	     /bin/sh -c /bin/ps -ax -o pid=,ppid=,pcpu=,pmem=,command=
    0	     0	  9373	       /bin/ps -ax -o pid=,ppid=,pcpu=,pmem=,command=
    0	   205	  9206	   window (Form.js - world-countries - Visual Studio Code)
    0	    79	  9227	     extensionHost
    0	   229	  9257	       electron_node tsserver.js 
   16	    79	  9269	         electron_node typingsInstaller.js typesMap.js 
    0	    55	  9243	     watcherService

Workspace Stats: 
|  Window (Form.js - world-countries - Visual Studio Code)
|    Folder (world-countries): 55 files
|      File types: js(12) scss(10) json(6) map(5) html(2) txt(2) css(2)
|                  gitignore(1) md(1) LICENSE(1)
|      Conf files: package.json(1) settings.json(1)

Also, does this reproduce in the latest VS Code insiders build?

I didn't try that before, I'll try now and get back to you asap.

@mowagih96
Copy link
Author

mowagih96 commented Feb 20, 2020

Also, does this reproduce in the latest VS Code insiders build?

I tried it and it is slightly better but the same problem remains. Moreover I think my OS become sluggish as soon as I launched VSCode Insider.
Here's the output of code-insiders --status

[11154:0220/134910.675787:ERROR:sandbox_linux.cc(369)] InitializeSandbox() called with multiple threads in process gpu-process.
[main 2020-02-20T11:49:10.699Z] [File Watcher (node.js)] Failed to watch /home/rogue/.config/Code - Insiders/User for changes using fs.watch() (Error: ENOSPC: System limit for number of file watchers reached, watch '/home/rogue/.config/Code - Insiders/User')
Version:          Code - Insiders 1.43.0-insider (9c341b3d8f2f41277be6dd59e7f4e847e6b594ac, 2020-02-20T05:39:45.923Z)
OS Version:       Linux x64 4.15.0-88-generic
CPUs:             Intel(R) Core(TM) i7-5500U CPU @ 2.40GHz (4 x 2890)
Memory (System):  7.71GB (1.13GB free)
Load (avg):       2, 1, 1
VM:               0%
Screen Reader:    no
Process Argv:     --no-sandbox --unity-launch
GPU Status:       2d_canvas:                     enabled
                  flash_3d:                      enabled
                  flash_stage3d:                 enabled
                  flash_stage3d_baseline:        enabled
                  gpu_compositing:               enabled
                  multiple_raster_threads:       enabled_on
                  oop_rasterization:             disabled_off
                  protected_video_decode:        unavailable_off
                  rasterization:                 disabled_software
                  skia_renderer:                 disabled_off_ok
                  video_decode:                  unavailable_off
                  viz_display_compositor:        enabled_on
                  viz_hit_test_surface_layer:    disabled_off_ok
                  webgl:                         enabled
                  webgl2:                        enabled

CPU %	Mem MB	   PID	Process
    0	   118	 10202	code-insiders main
    0	    32	 10205	   zygote
    0	    95	 10226	   gpu-process
    0	    47	 10242	   utility
    0	   103	 10317	   shared-process
    0	     0	 11177	     /bin/sh -c /bin/ps -ax -o pid=,ppid=,pcpu=,pmem=,command=
    0	     0	 11178	       /bin/ps -ax -o pid=,ppid=,pcpu=,pmem=,command=
    0	   245	 10575	   window (● WorldCountriesPage.js - world-countries - Visual Studio Code - Insiders)
    0	    95	 10597	     extensionHost
    0	    87	 10674	       electron_node tsserver.js 
    0	   331	 10675	       electron_node tsserver.js 
    7	   126	 10693	         electron_node typingsInstaller.js typesMap.js 
    0	    63	 10611	     watcherService

Workspace Stats: 
|  Window (● WorldCountriesPage.js - world-countries - Visual Studio Code - Insiders)
|    Folder (world-countries): 55 files
|      File types: js(12) scss(10) json(6) map(5) html(2) txt(2) css(2)
|                  gitignore(1) md(1) LICENSE(1)
|      Conf files: package.json(1) settings.json(1)

@mjbvz
Copy link
Contributor

mjbvz commented Feb 20, 2020

@MohamedWagih96 Is it the typingsInstaller.js process that always has high cpu usage?

Also, does high cpu usage remains even when you stop doing anything in the editor for a minute? Some cpu usage is expected while editing files but it should die down once editing stops

@mowagih96
Copy link
Author

@mjbvz Yes it is always high even while i'm not doing any coding. Matter of fact the results I posted were when I just opened the laptop and nothing else was running except VSCode.

@mjbvz
Copy link
Contributor

mjbvz commented Feb 21, 2020

Is it always the typingsInstaller.js process?

@mowagih96
Copy link
Author

Yes

@mjbvz mjbvz transferred this issue from microsoft/vscode Feb 21, 2020
@mjbvz
Copy link
Contributor

mjbvz commented Feb 21, 2020

Moving upstream. A TS team member should be able to help you investigate why the typings installer process cpu usage never dies down

@mjbvz mjbvz changed the title Typescript & Javascript language features extension in VSCode causes my laptop to overheat Continual CPU usage from typingsInstaller process Feb 21, 2020
@mjbvz mjbvz removed their assignment Feb 21, 2020
@RyanCavanaugh RyanCavanaugh added the Needs Investigation This issue needs a team member to investigate its status. label Feb 21, 2020
@RyanCavanaugh RyanCavanaugh added this to the TypeScript 3.9.0 milestone Feb 21, 2020
@mowagih96
Copy link
Author

mowagih96 commented Mar 1, 2020

Hello, Are there any updates on this issue?

@mowagih96
Copy link
Author

Ok, So this problem now only occurs with ReactJS projects no matter how small or big the project is.
I tried editing NodeJS project with VSCode with no issues.
So what is going on here now?

@mowagih96
Copy link
Author

mowagih96 commented Apr 18, 2020

Ok so it seems this answer solves the problem completely.
However, autocomplete is not working for some required/imported packages.
@RyanCavanaugh @sheetalkamat @DanielRosenwasser

@sheetalkamat
Copy link
Member

Duplicate of #25104
@MohamedWagih96 Please provide more details on repro and tsserver and ti log using typescript nightly drop and open new issue

You can upload logs by following these steps:

  1. Set "typescript.tsserver.log": "verbose"
  2. Restart vscode or vscode insiders
  3. Reproduce the problem
  4. In vscode or vscode insiders, run the TypeScript: Open TS Server log command
  5. This should open a large file called tsserver.log. Please share this file. Additionally you can also share file ti.log created next to it.

@sheetalkamat sheetalkamat added the Duplicate An existing issue was already created label Apr 22, 2020
@mowagih96
Copy link
Author

@sheetalkamat How exactly am I supposed to share these log files? Is there any conventional way of doing it? Because code --upload-logs is not working.

@sheetalkamat
Copy link
Member

You can upload logs by following these steps:

  1. Set "typescript.tsserver.log": "verbose"
  2. Restart vscode or vscode insiders
  3. Reproduce the problem
  4. In vscode or vscode insiders, run the TypeScript: Open TS Server log command
  5. This should open a large file called tsserver.log. Please share this file. Additionally you can also share file ti.log created next to it.

@jessietang
Copy link

Hello, Are there any updates on this issue?

@dixitanmol97
Copy link

The answer here helped me, but is there any better solution without compromising with the features available yet?

https://stackoverflow.com/questions/60297386/typescript-javascript-language-features-extension-in-vscode-causes-my-laptop-t/61289034#61289034

@adicandra1
Copy link

Hei, I just want to let you know that the stackoverflow answer mentioned by @dixitanmol97 above worked for me without breaking the autocomplete feature.

So in my case, I had a:

  • vue 2 + typescript (v.4.4) + Element UI + Storybook project,
  • running in vscode 1.62
  • OS Ubuntu 20.04

I had the same problem as mentioned above with vscode takes up constant cpu usage around 30%. I search around, then found that somehow VSCode built-in typescript extension watches node_modules folder outside the project (according to this comment ) .
I believe, this behaviour is caused by default feature for javascript project mentioned here that should be turned off for typescript project.

I also add some setting mentioned in this comment .

Summary I add these commands to my vscode workspace settings:

{
    "typescript.disableAutomaticTypeAcquisition": true,
    "typescript.workspaceSymbols.scope": "currentProject"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created Needs Investigation This issue needs a team member to investigate its status.
Projects
None yet
Development

No branches or pull requests

8 participants