Skip to content

tsserver causing 100% cpu usage (MacOS) #71746

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

Closed
rewrking opened this issue Apr 4, 2019 · 6 comments
Closed

tsserver causing 100% cpu usage (MacOS) #71746

rewrking opened this issue Apr 4, 2019 · 6 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) javascript JavaScript support issues perf upstream Issue identified as 'upstream' component related (exists outside of VS Code)

Comments

@rewrking
Copy link

rewrking commented Apr 4, 2019

Issue Type: Bug

Experiencing this after the latest VS Code Update (1.33.0) on MacOS (Mojave).

Just merely opening a .jsx file spawned a tsserver process that pegged the cpu at 100%. This continued for about an hour until I finally disabled the built-in JS/TS extension.

"ps aux | grep (PID of process)" yields:

(PID) 101.2 1.5 5775252 247640 ?? R 3:58PM 0:22.29 /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js --useInferredProjectPerProjectRoot --enableTelemetry --cancellationPipeName /var/folders/jf/lcpzpnrj18j12nh80mpby5640000gn/T/vscode-typescript/tscancellation-5c45dea462f9c216c776.tmp* --locale en --noGetErrOnBackgroundUpdate

These were the extension settings I was using:

"javascript.autoClosingTags": false,
"javascript.implicitProjectConfig.experimentalDecorators": true,
"javascript.updateImportsOnFileMove.enabled": "always",

"typescript.autoClosingTags": false,
"typescript.surveys.enabled": false,
"typescript.updateImportsOnFileMove.enabled": "always",

VS Code version: Code 1.33.0 (0dd516d, 2019-04-04T15:11:32.076Z)
OS version: Darwin x64 18.5.0

System Info
Item Value
CPUs Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz (8 x 2500)
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: enabled
rasterization: enabled
surface_synchronization: enabled_on
video_decode: enabled
webgl: enabled
webgl2: enabled
Load (avg) 2, 2, 2
Memory (System) 16.00GB (2.87GB free)
Process Argv
Screen Reader no
VM 0%
Extensions (14)
Extension Author (truncated) Version
language-x86-64-assembly 13x 2.2.11
gitlens eam 9.5.1
prettier-vscode esb 1.8.1
applescript idl 0.14.2
vscode-icon-theme jtl 1.6.5
dotenv mik 1.0.1
prettify-json moh 0.0.3
cpptools ms- 0.22.1
shader sle 1.1.4

(1 theme extensions excluded)

@vscodebot vscodebot bot added the new release label Apr 4, 2019
@mjbvz mjbvz self-assigned this Apr 5, 2019
@mjbvz
Copy link
Collaborator

mjbvz commented Apr 5, 2019

Can you please share the jsx files or more information about your project

@mjbvz mjbvz added the info-needed Issue requires more information from poster label Apr 5, 2019
@rewrking
Copy link
Author

rewrking commented Apr 5, 2019

The most basic React/styled-components .jsx file triggers it:

import React from "react";
import styled from "styled-components";

export default (props) => {
    const Section = styled.section`
        background-color: #000;
    `;

    return (
        <Section>
            <a href="http://www.google.com">Google</a>
        </Section>
    );
};

@mjbvz
Copy link
Collaborator

mjbvz commented Apr 5, 2019

Looks like microsoft/TypeScript#30663

@weswigham When are the new styled component definitions going to be published? A lot of VS Code users are going to hit this through automatic type acquisition

@mjbvz mjbvz added javascript JavaScript support issues perf upstream Issue identified as 'upstream' component related (exists outside of VS Code) and removed info-needed Issue requires more information from poster labels Apr 5, 2019
@hex20
Copy link

hex20 commented Apr 5, 2019

I'm seeing the same issue

102.0  3.7  5582432 312744   ??  R     2:07pm   2:53.94 /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js --useInferredProjectPerProjectRoot --enableTelemetry --cancellationPipeName /var/folders/wl/7zyj_dlj3jb17znt889_ndbh0000gn/T/vscode-typescript/tscancellation-f1c61d869c66684734c1.tmp* --globalPlugins typescript-styled-plugin,@divyenduz/ts-graphql-plugin --pluginProbeLocations /Users/angus/.vscode/extensions/jpoissonnier.vscode-styled-components-0.0.26,/Users/angus/.vscode/extensions/prisma.vscode-graphql-0.1.7 --locale en --noGetErrOnBackgroundUpdate

@ScreamZ
Copy link

ScreamZ commented Apr 5, 2019

Seems related to new version that use TS 3.4.1, seems to get better when switching to 3.3.3333 in node modules

@mjbvz
Copy link
Collaborator

mjbvz commented Apr 5, 2019

Duplicate of #71751

See #71751 (comment) for workarounds

If that doesn't solve the issue for you, please open a new issue

@mjbvz mjbvz closed this as completed Apr 5, 2019
@mjbvz mjbvz added the *duplicate Issue identified as a duplicate of another issue(s) label Apr 5, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators May 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s) javascript JavaScript support issues perf upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Projects
None yet
Development

No branches or pull requests

4 participants