Rust File Watcher Consumed 23.6 GB of RAM, Ignoring Our Rules
A Rust file watcher ignored ignore rules, consuming 23.6 GB of RAM. Switching to NoCache resolved the issue.
We are developing a local-first indexer for macOS that monitors the user's home directory to reindex only changed files. However, watching a real user's $HOME led to unexpected memory issues, with the app reaching around 25 GB shortly after launch. The root cause was identified as a cache structure that disregarded ignore rules while tracking file IDs under the watch root. By switching to NoCache, we reduced memory usage from 24.8 GB to 1.45 GB, effectively addressing the issue.