question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

electron_node tsserver.js using >100 CPU

See original GitHub issue

Issue Type: Bug

Within the last week I have been struggling with vscode/typescript using upwards of 100% CPU. This leads to 10-30 second delays for intellisense for trivial changes.

The main culprit appears to be electron_node tsserver.js.

I’ve seen a few similar issues but none seem to get the to root of the issue, so apologies if this is a duplicate. This looks similar to https://github.com/microsoft/vscode/issues/96255 but I am experiencing this issue with all extensions disabled.

I first notice the issue using typescript@3.8.3. Then I tried using the nightly build per suggestion here https://github.com/microsoft/TypeScript/issues/34401#issuecomment-541947997. This worked for a day but then the issues resurfaced.

Any help debugging this would be greatly appreciated.

output from code --status after simple code change.

Version:          Code 1.44.2 (ff915844119ce9485abfe8aa9076ec76b5300ddd, 2020-04-16T17:07:18.473Z)
OS Version:       Darwin x64 19.4.0
CPUs:             Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz (16 x 2400)
Memory (System):  32.00GB (0.04GB free)
Load (avg):       3, 2, 2
VM:               0%
Screen Reader:    no
Process Argv:     .
GPU Status:       2d_canvas:                     enabled
                  flash_3d:                      enabled
                  flash_stage3d:                 enabled
                  flash_stage3d_baseline:        enabled
                  gpu_compositing:               enabled
                  metal:                         disabled_off
                  multiple_raster_threads:       enabled_on
                  oop_rasterization:             disabled_off
                  protected_video_decode:        unavailable_off
                  rasterization:                 enabled
                  skia_renderer:                 disabled_off_ok
                  video_decode:                  enabled
                  viz_display_compositor:        enabled_on
                  viz_hit_test_surface_layer:    disabled_off_ok
                  webgl:                         enabled
                  webgl2:                        enabled

CPU %	Mem MB	   PID	Process
    0	   131	 23817	code main
    0	    66	 23830	   gpu-process
    0	    33	 23832	   utility
    0	   295	 23833	   window (portal.tsx — elastic-charts)
    0	    98	 23836	     extensionHost
    0	    98	 23838	       electron_node tsserver.js
  100	   623	 23839	       electron_node tsserver.js
    0	    33	 23854	         electron_node typingsInstaller.js typesMap.js
    0	    33	 23866	       /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Renderer).app/Contents/MacOS/Code Helper (Renderer) /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/json-language-features/server/dist/jsonServerMain --node-ipc --clientProcessId=23836
    0	    33	 23837	     watcherService
    0	    33	 23911	     searchService
    0	    66	 23860	   shared-process
    0	     0	 24878	     /bin/ps -ax -o pid=,ppid=,pcpu=,pmem=,command=
    0	    66	 24847	   window (Issue Reporter)

Workspace Stats:
|  Window (portal.tsx — elastic-charts)
|    Folder (elastic-charts): 2705 files
|      File types: ts(640) map(600) png(534) js(314) tsx(307) scss(31) md(17)
|                  json(16) mdx(12) DS_Store(4)
|      Conf files: tsconfig.json(5) webpack.config.js(3) package.json(1)
|                  launch.json(1) settings.json(1)
|      Launch Configs: node(2)

VS Code version: Code 1.44.2 (ff915844119ce9485abfe8aa9076ec76b5300ddd, 2020-04-16T17:07:18.473Z) OS version: Darwin x64 19.4.0

System Info
Item Value
CPUs Intel® Core™ i9-9980HK CPU @ 2.40GHz (16 x 2400)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: enabled
webgl2: enabled
Load (avg) 3, 2, 2
Memory (System) 32.00GB (0.19GB free)
Process Argv .
Screen Reader no
VM 0%
Extensions: none

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:25
  • Comments:14 (1 by maintainers)

github_iconTop GitHub Comments

18reactions
Undistractioncommented, May 6, 2020

@nickofthyme Try checking ‘TypeScript: Disable Automatic Type Acquisition’ in the settings. That seems to have helped, for me at least.

4reactions
brascenecommented, Jul 9, 2021

Is this issue resolved or no one except me is facing this? I have the same issue, and it started all of a sudden, because during last year VSCode was running very smoothly, with no delays or errors at all, and yesterday it blocked the whole intellisense, autocomplete, imports, everything, it’s just stuck in loading state and I can see in that electron_node tsserver or Code Helper (Renderer) process is taking more than 100CPU. I’ve tried with installing many different (older) versions of VSCode but nothing looks like it’s not related with that.

Really don’t know what to do, I’m on M1 Mac, project is React Native, Typescript, I have only two extensions (Eslint and Prettier), but even without them I get the same issue.

Any advices/suggestions will be appreciated a lot…

Read more comments on GitHub >

github_iconTop Results From Across the Web

electron_node bundle.js using a lot of CPU in vscode
js process doing exactly in VS Code, it's using a lot of CPU and makes my laptop very noisy even when just editing...
Read more >
Typescript Service uses 100% CPU all the time ... - YouTrack
With previous versions of Typescript the CPU usage raises to 100% while the project is compiled, but then goes back to 0.5% while...
Read more >
tsserver process reporting high CPU consumption
I am seeing node process for tsserver.js continuously running and then staying at 25% CPU usage. I have to eventually kill the process....
Read more >
How To Use More Cores To Speed Up Visual Studio Code'S ...
slow 100% CPU usage coming from electronnode tsserver.js CPU usage of VSCode 1.32.0; Installing latest VSCode Insiders; Increased max memory. Mitsuya Watanabe ......
Read more >
TsServer spawning a billion node processes and killing my CPU
Gives 100 Reddit Coins and a week of r/lounge access and ad-free When you come across a feel-good thing. 3
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found