Typescript: Code Helper high CPU (electron_node tsserver.js)

Created on 13 Oct 2019  Â·  7Comments  Â·  Source: microsoft/TypeScript


Disclaimer : Went through other issues to identify duplicates. None of the other open issues have provided any solution.

  • VSCode Version: 1.39.1
  • OS Version: macOS 10.15

Steps to Reproduce:

  1. Open project folder in VSCode with a file open in the editor.
  2. Delete node_modules from terminal.
  3. Run yarn install.
    This causes a CPU spike. The activity monitor shows the process taking most CPU as Code Helper (taking over 100% CPU).


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

Output of code --status

Version:          Code 1.39.1 (88f15d17dca836346e787762685a40bb5cce75a8, 2019-10-10T23:35:11.314Z)
OS Version:       Darwin x64 19.0.0
CPUs:             Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz (8 x 2200)
Memory (System):  16.00GB (2.54GB free)
Load (avg):       4, 3, 3
VM:               0%
Screen Reader:    no
Process Argv:     --disable-extensions .
GPU Status:       2d_canvas:                     enabled
                  flash_3d:                      enabled
                  flash_stage3d:                 enabled
                  flash_stage3d_baseline:        enabled
                  gpu_compositing:               enabled
                  multiple_raster_threads:       enabled_on
                  native_gpu_memory_buffers:     enabled
                  oop_rasterization:             disabled_off

 protected_video_decode:        unavailable_off
                  rasterization:                 enabled
                  skia_deferred_display_list:    disabled_off
                  skia_renderer:                 disabled_off
                  surface_synchronization:       enabled_on
                  video_decode:                  enabled
                  viz_display_compositor:        disabled_off
                  webgl:                         enabled
                  webgl2:                        enabled

CPU %   Mem MB     PID  Process
    0       82   96508  code main
    0       66   96533     gpu-process
    0      246   96555     window (OrderBusinessTest.ts — alfred)
    0       66   96563       extensionHost
    0       82   96678         electron_node tsserver.js
  101      868   96679         electron_node tsserver.js
    0       49   96736           electron_node typingsInstaller.js typesMap.js
    0       82   96564       watcherService
    0       33   96651       searchService
    0       98   96602     shared-process
    0        0   98020       /bin/ps -ax -o pid=,ppid=,pcpu=,pmem=,command=

Workspace Stats:
|  Window (OrderBusinessTest.ts — alfred)
|    Folder (alfred): 837 files
|      File types: ts(166) js(164) map(158) html(41) json(25) sh(13) woff(12)
|                  ttf(12) woff2(12) eot(12)
|      Conf files: gulp.js(1) package.json(1) tsconfig.json(1) tslint.json(1)
|                  launch.json(1) tasks.json(1)
|      Launch Configs: node(2)

Output of running Developer: Open Process Explorer in command palette
Screenshot 2019-10-14 at 1 44 02 AM

PFA the TS Server log output collected by following the steps mentioned here
out.log

Fix Available

Most helpful comment

Can you please try upgrading your workspace to use typescript@next by installing this extension. Do you still this issue after installing that extension and restarting VS Code?

All 7 comments

Can you please try upgrading your workspace to use typescript@next by installing this extension. Do you still this issue after installing that extension and restarting VS Code?

Installed the extension JavaScript and TypeScript Nightly.
Went to command palette -> Select Typescript Version -> VS Code version -> 3.7.0-dev.20191014
Restarted VSCode
Behaviour remains same

@mjbvz This seems to have resolved the issue! Thanks!

@pravesh-curefit can you please try out with build from https://github.com/microsoft/TypeScript/pull/35615#issuecomment-564263744 to see if it helps. If not please provide complete tsserver log to be able to investigate this further

@sheetalkamat When I tried by adding a devDependency
"typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/57410/artifacts?artifactName=tgz&fileId=C56D34170AE2E201F9C6006F088E430E6DCD20FE710334CDAA4E0AA14B6BCD2A02&fileName=/typescript-3.8.0-insiders.20191210.tgz"
I did not get the CPU issue. Does that meant he issue is due to a typescript version?

@mjbvz that extension seems to have solved my issue. Thank you.
Think I spoke too soon.

@pravesh-curefit that means that the #35615 is fix for your issue as I suspected.

Was this page helpful?
0 / 5 - 0 ratings