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

RG 700% CPU usage #55649

Closed
reggiew2 opened this issue Aug 2, 2018 · 17 comments
Closed

RG 700% CPU usage #55649

reggiew2 opened this issue Aug 2, 2018 · 17 comments
Assignees
Labels
search Search widget and operation issues verified Verification succeeded

Comments

@reggiew2
Copy link

reggiew2 commented Aug 2, 2018

Issue Type: Bug

I found an issue where RG 700% CPU usage when I have my home dir open and expanded. I did this so I can easly access files. When I open to a different folder like desktop the issue goes away. I have repoed with all extensions disabled.

VS Code version: Code 1.25.1 (1dfc5e5, 2018-07-11T15:33:29.235Z)
OS version: Darwin x64 17.7.0

System Info
Item Value
CPUs Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz (8 x 2200)
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
rasterization: enabled
video_decode: enabled
video_encode: enabled
vpx_decode: enabled
webgl: enabled
webgl2: enabled
Load (avg) 4, 4, 7
Memory (System) 16.00GB (3.79GB free)
Process Argv /Applications/Visual Studio Code.app/Contents/MacOS/Electron
Screen Reader no
VM 0%
Extensions (9)
Extension Author (truncated) Version
vscode-eslint dba 1.4.12
xml Dot 2.3.1
gitlens eam 8.5.4
json-tools eri 1.0.2
code-runner for 0.9.3
python ms- 2018.7.1
PowerShell ms- 1.8.2
vscode-icons rob 7.25.0
propertylist zho 0.0.2
@vscodebot
Copy link

vscodebot bot commented Aug 2, 2018

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@reggiew2
Copy link
Author

reggiew2 commented Aug 2, 2018

This bug is repo without any extensions enabled. The bug noted above talks about an extension issue. I was able to see it with or without extensions.

@isidorn
Copy link
Contributor

isidorn commented Aug 2, 2018

Can you please give us reproducable steps so we can try to look into this?
What does RG stand for?

@isidorn isidorn added the info-needed Issue requires more information from poster label Aug 2, 2018
@reggiew2
Copy link
Author

reggiew2 commented Aug 2, 2018

The repo steps is open the home folder on a mac then expand it on the UI. RG is what shows up on Activity Monitor. I had no other files open in the main window.

@isidorn
Copy link
Contributor

isidorn commented Aug 2, 2018

Sounds like rip grep.
I can not repro

@isidorn isidorn removed the info-needed Issue requires more information from poster label Aug 2, 2018
@reggiew2
Copy link
Author

reggiew2 commented Aug 2, 2018

ok, I was wrong before, sorry about that. The RG issue is caused by vscode-icons. However I also found an issue with Code by itself. The CPU goes to 100%+ when the home folder is open. I have a video of the issue and going through the RG issue with Activity Monitor on screen. https://citrix.sharefile.com/d/s09e54c7c59d4833a

@garthk
Copy link

garthk commented Aug 13, 2018

I'm seeing this also. At each reload, I get another copy of VS Code's ripgrep running away with as much %CPU as it can get and slowly gaining %MEM. ps auxww shows the COMMAND:

/Applications/Visual Studio Code.app/Contents/Resources/app/node_modules.asar.unpacked/vscode-ripgrep/bin/rg --files --hidden --case-sensitive -g **/tsconfig.json -g **/jsconfig.json -g **/tsconfig.*.json -g **/jsconfig.*.json --no-ignore --follow --quiet -- .

VS Code does not kill the process as it quits.

@garthk
Copy link

garthk commented Aug 14, 2018

  • Reproduced 29 times while disabling extensions one at a time to see if any of them were the culprit
  • Happens even if no editors are open
  • Workspace specific:
    • doesn't happen if I close that workspace and open another
    • does happen if I close the other workspace and re-open the first
    • still happens if I empty out that workspace's .vscode
    • still happens if I ⌘⇧P Clear Editor History
    • still happens if I ⌘⇧P Clear Command History
    • still happens if I ⌘⇧P File: Clear Recently Opened
  • VS Code 1.26.0
  • macOS 10.13.6

Any other diagnostic steps I can try?

@garthk
Copy link

garthk commented Aug 14, 2018

Is this #34711? This workspace has 521756 files after npm install. Long story.

@reggiew2
Copy link
Author

@garthk The RG issue is caused by vscode-icons. Once I removed it all is good.

@garthk
Copy link

garthk commented Aug 15, 2018

@reggiew2 I'm getting matching symptoms without vscode-icons.

@zzarcon
Copy link

zzarcon commented Aug 15, 2018

I can confirm I'm having the same issue since the 1.26.0 update. I disabled all my extensions and CPU still goes above 600%

@roblourens
Copy link
Member

roblourens commented Aug 15, 2018

Please try this

  • Search @builtin in the extension viewlet
  • Under the "Features" section find the "Typescript and JavaScript Language Features" extension
  • Disable it

It looks like it added a new workspaceContains activation event.

@mjbvz Is the workspaceContains activation event necessary? Can you activate on onLanguage:json instead?

It's expensive. There's another issue to cut those searches off after some timeout which we really should do for August.

@zzarcon
Copy link

zzarcon commented Aug 15, 2018

Thanks @roblourens. Disabling the TypeScript and JavaScript Language Features extension does the trick.

Is there any other workaround we can use currently in order to override the workspaceContains prop of the extension?

Disabling the TypeScript and JavaScript Language Features extension removes a lot of value from VScode 💔.

Thanks for the solution in the meantime!

@roblourens roblourens added search Search widget and operation issues under-discussion Issue is under discussion for relevance, priority, approach labels Aug 15, 2018
@roblourens roblourens added this to the August 2018 milestone Aug 15, 2018
roblourens added a commit that referenced this issue Aug 15, 2018
chrmarti pushed a commit that referenced this issue Aug 16, 2018
chrmarti pushed a commit that referenced this issue Aug 16, 2018
@chrmarti chrmarti added the candidate Issue identified as probable candidate for fixing in the next release label Aug 16, 2018
@chrmarti
Copy link
Contributor

Merging @roblourens 's fix for 1.26.1.

@chrmarti chrmarti added the verified Verification succeeded label Aug 16, 2018
@egamma egamma removed candidate Issue identified as probable candidate for fixing in the next release under-discussion Issue is under discussion for relevance, priority, approach labels Aug 17, 2018
@DanTup
Copy link
Contributor

DanTup commented Aug 17, 2018

@roblourens

Is the workspaceContains activation event necessary? Can you activate on onLanguage:json instead?

I'm using workspaceContains in Dart to activate when opening a Dart project (pubspec.yaml or .dart file):

"activationEvents": [
		"onLanguage:dart",
		"onView:dartPackages",
		"workspaceContains:**/pubspec.yaml",
		"workspaceContains:**/*.dart",
		"onCommand:flutter.createProject",
		"onCommand:flutter.doctor"
],

Is this bad, should I avoid it? It's a bit naff if we require the user to open a file before we activate, but I don't want to be causing issues like this!

@roblourens
Copy link
Member

roblourens commented Aug 17, 2018

No, you don't need to avoid it - we are improving it in #34711. It can be annoying right now for a small set of users and I just wanted to avoid having it out of the box.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
search Search widget and operation issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

8 participants