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 (1dfc5e557209371715f655691b1235b6b26a06be, 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
(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:
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.
Can you please give us reproducable steps so we can try to look into this?
What does RG stand for?
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.
Sounds like rip grep.
I can not repro
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
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.
.vscodeClear Editor HistoryClear Command HistoryFile: Clear Recently OpenedAny other diagnostic steps I can try?
Is this #34711? This workspace has 521756 files after npm install. Long story.
@garthk The RG issue is caused by vscode-icons. Once I removed it all is good.
@reggiew2 I'm getting matching symptoms without vscode-icons.
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%
Please try this
@builtin in the extension viewletIt 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.
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!
Merging @roblourens 's fix for 1.26.1.
@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!
No, you don't need to avoid it - we are improving it in https://github.com/Microsoft/vscode/issues/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.
Most helpful comment
Please try this
@builtinin the extension viewletIt looks like it added a new workspaceContains activation event.
@mjbvz Is the workspaceContains activation event necessary? Can you activate on
onLanguage:jsoninstead?It's expensive. There's another issue to cut those searches off after some timeout which we really should do for August.