vscode: macOS: high CPU from file watcher in presence of cyclic symbolic links in workspace

There are some reports from macOS users seeing high CPU in the watcher service process:

In September we updated our file watcher library chokidar from 3.2.3 to 3.4.2 (https://github.com/microsoft/vscode/commit/0de4890a28ab466c340a94fad33e5e8c16cac89d) with the goal to actually reduce the CPU load. I tested this on macOS and Linux and found the CPU pressure to be smaller. This also matches what was announced from their release notes.

@n808 @victorpavlov @davidham @hDmtP merging your issues into here. What would help is to understand better what kind of folder you open triggers this:

  • does this NOT reproduce with 1.49.3 (download)
  • could it have cyclic symbolic links
  • would I be able to get access to such a folder to try for myself
  • does the high CPU load eventually go away or stay high?

//cc @paulmillr for additional insights if possible

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 2
  • Comments: 25 (10 by maintainers)

Commits related to this issue

Most upvoted comments

@hDmtP sorry sure: a symbolic folder link that eventually points to a parent of that symbolic link so that if you would iterate over the folders it would be endless.

@victorpavlov thanks, so this looks to be the issue, having cyclic symbolic links in the project structure.

does the high CPU load eventually go away or stay high?

Yes, after around 18-20 minutes the system goes back to normal.

It turns out my project had a symbolic link pointing back to the root of the project. When I removed this link, CPU usage is normal on startup. (So that solves the issue for my part, as the link was not really necessary.)