facebook / watchman

Watches files and records, or triggers actions, when they change.
https://facebook.github.io/watchman/
MIT License
12.57k stars 987 forks source link

Memory issue with large array for ignore_dirs #995

Open andrew-paterson opened 2 years ago

andrew-paterson commented 2 years ago

I'd like to ignore all but one of 1200 directories in the node_modules for an Ember.js (node) application.

I added the 1199 directories to the ignore_dirs array in .watchmanconfig, and when I try to boot up my app, the watchman process starts eating all of my system memory, and eventually fails.

image

Everything works fine when ignore_dirs does not include any children of node_modules, but then it's watching 120 000 files unnecessarily, and I often need to have several apps running at once, and system limits become an issue.