-
Notifications
You must be signed in to change notification settings - Fork 29.2k
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
When using cnpm/pnpm, rg uses lots of CPU #35659
Comments
Your report isn't very clear (not sure what rg.exe is), but on Ubuntu, I'm getting 100% cpu spikes just from typing. I'm desperately looking for a way to download the version previous to this one. |
file location \Microsoft VS Code\resources\app\node_modules\vscode-ripgrep\bin\rg.exe |
run as administrator the problem still exists. |
Could you check what the command arguments are? |
Also: Does this happen immediately after opening the window or only after using Ctrl + P to show QuickOpen? |
If my project exists node_modules folder will appear cpu 100% of the situation |
https://code.visualstudio.com/updates/v1_16 |
Hi, the same bug occours on my Surface Pro3. EnvOS: win64 How to reproduceOpenning a npm package containing a If I choose to wait for a min , the |
Everyone seeing this: Is this right after starting the application or only after using Ctrl + P (Cmd + P on Mac) to open a file? Could you also check what command parameters |
@chrmarti Hi . sorry for the late reply.
It's right that the CPU usage grows quickly to 100% after starting the vscode , but I can't reproduce the error when openning a file using Ctrl+P.
"c:\Program Files\Microsoft VS Code\resources\app\node_modules\vscode-ripgrep\bin\rg" --files --hidden --case-sensitive -g *.csproj -g *.sln -g *.csx -g **/*.csproj -g **/*.sln -g **/*.csx --no-ignore --follow -- . however , when I used my desktop in my office in the morning today,I could not reproduce the same bug on my win7 x64 desktop : win7 professional x64 SP1( 6.1.7601 ) After going home , I come back to my Surface Pro3 (the Surface Pro3 OS: Microsoft Windows [版本 10.0.15063] x64) and try to disable extenstions to see whether it is caused by some extension. Here's my result: with ms-vscode.csharp installed , the @617450941 @cipchk do you get the ms-vscode.csharp installed? |
My cpu no matter how long it is maintained at 100% in exchange for the old version did not appear this situation |
@newbienewbie @617450941 but not all projects, have to meet the following qualifications:
|
Could you run the following command in Powershell from your workspace folder and let me know what the output is?
|
Also, what is the output of the following when run in Powershell while the
|
enter
HTH! the {
"name": "Manage",
"version": "1.0.0",
"author": "@cipchk",
"dependencies": {
"time-require": "^0.1.2"
},
"devDependencies": {
"gulp": "^3.9.1",
"gulp-angular-htmlify": "^2.3.0",
"gulp-changed": "^3.1.0",
"gulp-concat": "^2.6.0",
"gulp-if": "^2.0.0",
"gulp-inject": "^4.0.0",
"gulp-livereload": "^3.8.1",
"gulp-clean-css": "^3.5.0",
"gulp-minify-html": "^1.0.6",
"gulp-ng-annotate": "^2.0.0",
"gulp-ng-html2js": "^0.2.2",
"gulp-rename": "^1.2.2",
"gulp-sass": "^3.1.0",
"gulp-sync": "^0.1.4",
"gulp-uglify": "^3.0.0",
"gulp-util": "^3.0.7",
"gulp-wrap": "^0.13.0",
"path": "^0.12.7",
"through2": "^2.0.1"
}
} |
@cipchk I don't have my surface pro3 at hand , so I can't test the command now . While on the desktop in my office , the first command will issue a lot of errors (os error 3) that complain about “File system loop found” and “path not found ”. To get a complete output , you can redirect the stderr to a file like this :
can you upload the complete out.txt ? for the second command :
the output is : "C:\Program Files\Microsoft VS Code\resources\app\node_modules\vscode-ripgrep\bin\rg.exe" --files --no-ignore --follow - Is that the same to your output ? |
@newbienewbie Yes. my steps:
so, the out.txt content. |
Could you rerun the Please run the |
@chrmarti There will be no the all output content:
the |
@cipchk Which version of npm did you use to install the node_modules? I'm trying to reproduce the problem. I'm not sure yet if removing |
my env:
and, the {
"name": "ps-h5",
"version": "1.0.0",
"author": "@cipchk",
"dependencies": {},
"devDependencies": {
"babel-preset-es2015": "6.24.1",
"event-stream": "3.3.2",
"gulp": "3.9.1",
"gulp-angular-htmlify": "2.3.0",
"gulp-babel": "6.1.2",
"gulp-bom": "1.0.0",
"gulp-buffer": "0.0.2",
"gulp-changed": "3.1.0",
"gulp-clean-css": "3.5.0",
"gulp-concat": "2.6.0",
"gulp-if": "2.0.2",
"gulp-inject": "4.2.0",
"gulp-livereload": "3.8.0",
"gulp-minify-html": "1.0.4",
"gulp-modify-file": "^1.0.0",
"gulp-ng-annotate": "2.0.0",
"gulp-ng-html2js": "0.2.0",
"gulp-rename": "1.2.2",
"gulp-sass": "3.1.0",
"gulp-sequence": "^0.4.6",
"gulp-sync": "0.1.4",
"gulp-uglify": "3.0.0",
"gulp-util": "^3.0.6",
"gulp-wrap": "0.13.0",
"lodash": "4.17.4",
"map-stream": "0.0.7",
"merge-stream": "1.0.1",
"merge2": "1.0.2",
"path": "0.12.7",
"rev-hash": "^2.0.0",
"run-sequence": "^2.2.0",
"sort-keys": "^2.0.0",
"through2": "2.0.0",
"vinyl-file": "^3.0.0"
}
} All of the above. |
将vscode 中的 search.followSymlinks:设置为false亲测可行 |
I am having this same issue. The command line looks like this:
This operation is completely inappropriate in my environment. By design, the In my repro, I did not perform any searches using the search tab. I simply launch VS Code and it immediately spawns rg.exe. Has anyone figured out why VS Code is doing this? It is it a plugin? Is it a misguided feature of VS Code itself? |
Workaround: Deleting rg.exe seems to eliminate the problem without any apparent loss of functionality in VS Code. |
I am running into the same problem: the second I press ctrl+p it starts eating cpu. What's cnpm? I just opened a directory using VSCode and have no idea what cnpm is. |
@pgonzal Deleting rg.exe will probably break quick open/search features. |
Setting note: I have removed every symlink, and also the node_modules directory but I still get the bug. Here is the command line that's used:
|
I also have the issue of VScode running at 100% cpu when doing a file search. |
@BurntSushi is this the same issue that you fixed in BurntSushi/ripgrep#633? If so does VS Code just need to upgrade? |
@pgonzal I think unfortunately there isn't a simple answer to that question. I guess the closest answer is "wontfix" or more like "unable to fix." There is just a fundamental limit on how fast a tool can process a directory tree containing 2 million entries. You'll need to read my comment to understand this issue from ripgrep's end. (Others are reporting issues even when symlinks are disabled, but I need a reproducible case outside of VS code on my end.) |
I think I found a workaround: replacing the |
@warpdesign Now that would be interesting. Can anyone provide the exact command being run (where 0.6.0 works and 0.7.1 or 0.8.0 doesn't) and a corpus to reproduce it with? |
What might explain the renewed interest here: We updated to ripgrep 0.7.1 for the VS Code 1.20 released last week. VS Code 1.19 was based on 0.6.0. |
@pgonzal The command arguments you posted indicate that the file search was triggered by an extension for C# that would activate for certain file types. Could you disable that extension and see if that works around the problem? |
@pgonzal One other thing to try first would be to make sure you have |
@warpdesign Could you try running the original |
This issue is for a specific issue affecting people using cnpm/pnpm. The fix for that will probably come with #34711 and with extensions not making wide-ranging searches over all of node_modules. I don't want this to be a general discussion thread. @warpdesign and anyone not using those tools, please open a new issue with specific repro steps. Also if you put old rg.exe into insiders 1.21, it will break, so make sure that search/quickopen works at all. |
@shrivatsahosabettu AIUI, that's not disk space, but disk bandwidth. And rg.exe is only using a paltry |
I think we have addressed this issue with QuickOpen and text search when there are a lot of symlinks (cnpm/pnpm) in the folder being searched by adding the setting For any remaining issues, especially regressions between releases, please open a new issue so we can follow up with you on the details. Thanks. |
@chrmarti I think you are closing the issue too quickly: as I said above, adding Also, I need to be able to search through symlinks. I'll open a new one but I think it's related. |
@BurntSushi. In the screen print only 2 items are running as of now. But some more are running below that also. One more thing I noticed is this will run for first 5-6 min of my VS Code launch where the disk will become 100%, after 5-6 min all the rg.exe will disappear and disk size will come down to 36-40. |
@warpdesign Let's continue the investigation in a new GitHub issue. It sounds like your problem is not the same we discussed and fixed here. When you open a new issue could also do the following and include the result: Try running the original Thanks. |
@shrivatsahosabettu If this reproduces also with the setting |
update vscode 1.17.0 CPU usage at 100% rg.exe bug?
The text was updated successfully, but these errors were encountered: