-
Notifications
You must be signed in to change notification settings - Fork 29.5k
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
fileWatcher at 100% CPU #226050
Comments
A bit more information:
|
Does it go away if you set And can you share a repository where this happens easy to reproduce? |
Thank you. It is not easy to reproduce. Here is the repo: https://github.com/streetsidesoftware/vscode-spell-checker Setup is:
I will try it out. It might be related, since it seem to happen quicker if I do a bit of refactoring or delete |
Thank you. |
I had a similar problem with the the repository is https://github.com/concrete-utopia/utopia, working inside the |
Thank you for the repo case. I hadn't found a good case in my own repos to properly test it out. |
@balazsbajorics thanks, I tried to repro (on macOS) but do not see that. Is there a build step involved (maybe PNPM?) to get this into that state? When I set log level to trace and open the file watcher output channel, I only see a small amount of recursively watched folders, maybe you could check too:
|
ℹ I would appreciate if people impacted here could try out our latest insiders build (commit Steps:
Happy to hear back how it goes 🙏 |
hi @bpasero, i have been tracking this issue as well (albeit in a vscode 1.91.1 fork), and I have reason to believe this would be fixed by upgrading: Line 77 in 7eae20c
to v2.3.0 or newer, to include: parcel-bundler/watcher#146 when this happened to me earlier, I attached Instruments.app (and after loading the associated v29.4.0 electron dSYMs), saw the following: it appears to be stuck in this loop:
this makes little sense, and could only happen if something massively got corrupted in the linked list somehow. on the libuv side, things have been stable for quite a while. there are some old issues that describe possibly-related behavior:
nothing directly confirming my theory in these old threads.. but if a process running nothing but the |
The easiest way to diagnose this is using
|
@tmm1 👏 great findings. Yes, @deepak1556 and me where tracing this issue as well some weeks ago using Instruments and found the call site, but were clueless as to how this could happen. We also figured out that updating to latest parcel watcher resolves this issue and that is actually the reason I went ahead and started an experiment to try out this new version. Unfortunately it has a serious bug and a engineering change that currently block us from adopting this version:
The former, I was able to address in parcel-bundler/watcher#189 but needs a newer release. The endless CPU spike only seems to happen when a massive amount of paths is watched at the same time, potentially overlapping, as it is the case before 88b706b landed where I enforce the TypeScript extension to re-use the workspace watcher instead of spawning their own. I am still trying to get newer parcel watcher builds, but we are currently blocked and I hope things move on again soon so that we can update. Thanks for your contributions to the watcher, if you see more things, please make sure to let us know 🙏 |
Wow you guys are way ahead of me. Thanks for all the links, as I had missed this side of the discussion! I suspected the npm distribution changes might be a problem. I will take a look there. |
Right. I can confirm using the latest parcel version (including your deadlock fix) has not replicated this issue for us in several weeks. But on the latest vscode (with old parcel version + overlapping workaround), it seems to happen just as frequently as before. |
Enabling trace level and printing what the file watcher channel prints as watched paths, can you share that to see what kind of watching situation you have before it happens? |
Type: Performance Issue
fileWatcher
process oftens gets stuck at 100% CPU.It seems to be SCM related, but hard to tell.
VS Code version: Code 1.92.2 (Universal) (fee1edb, 2024-08-14T17:29:30.058Z)
OS version: Darwin x64 23.6.0
Modes:
System Info
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Process Info
Workspace Info
Extensions (93)
(1 theme extensions excluded)
A/B Experiments
It is hard to say if it is related, but copilot tends to get stuck after killing the watcher.
The text was updated successfully, but these errors were encountered: