Defaulting to making $HOME writeable leads to fseventsd consuming significant memory
Description
I have a macbook m1 pro with 64GB of ram and fseventsd was taking up to 28GB (I left the laptop on during the weekend). I had AI analyze what was the root cause: can you check the current processeses and see why fseventsd it taking 28GB of memory
● Shell ps aux | grep -i fseventsd | grep -v grep ● Shell ps aux --sort=-%mem | head -20 ● Shell ps aux -m | head -20 ● Shell sudo ls -la /.fseventsd/ 2>/dev/null || echo "No access"; du -sh /System/Volumes/Data/.fseventsd 2>/dev/null || echo "Cannot check fseventsd data" ● Shell uptime; echo "---"; ps -p 345 -o pid,ppid,%cpu,%mem,rss,vsz,etime,command ● Shell log show --predicate 'process == "fseventsd"' --last 1m --info 2>/dev/null | tail -5; echo "---"; fs_usage -w -f filesys fseventsd 2>/dev/null & sleep 2 && kill %1 2>/dev/null; echo "---check watchers---"; lsof -c fseventsd 2>/dev/null | wc -l ● Shell lsof -p 345 2>/dev/null | wc -l; echo "---"; lsof -p 345 2>/dev/null | tail -30 ● Shell ps aux | grep -i docker | grep -v grep | head -5; echo "---"; ps aux | grep -i "node.*watch|webpack|ng serve|npm.*start|fswatch|watchman" | grep -v grep | head -10
Here's what I found:
The culprit: Colima with --inotify watching your entire home directory.
/opt/homebrew/opt/colima/bin/colima daemon start default --inotify --inotify-runtime docker --inotify-dir /Users/XXXX/
Key stats for fseventsd (PID 345):
- RSS: ~7.5 GB (actual physical memory)
- VSZ: ~463 GB (virtual address space — this is the "28GB" you're seeing, though it's actually virtual)
- CPU: 99.5% (pegged)
- Uptime: 3 days (since boot on Friday)
- System load average: 106 (extremely high)
Root cause: Colima is configured with --inotify-dir /Users/XXXX/ which makes it watch your entire home directory for filesystem changes to sync with the Docker VM. This generates a massive volume of FSEvents that fseventsd has to track, causing it to accumulate memory and burn CPU continuously.
I modified the .colima/default/colima.yaml and am monitoring:
Colima default behaviour: $HOME is mounted as writable.
Default: []
I added a: mounts:
- location: ~/Projects/Colima writable: true
I have colima installed through brew: ❯ brew list --versions | grep -i colima colima 0.10.1
Version
colima version && limactl --version && qemu-img --version colima version 0.10.1 git commit: ed905203afdbc6fd4eae6cc301918099ff31e86e limactl version 2.1.1 zsh: command not found: qemu-img
notice i do not have qemu-img
Operating System
- macOS Intel <= 13 (Ventura)
- macOS Intel >= 14 (Sonoma)
- Apple Silicon <= 13 (Ventura)
- Apple Silicon >= 14 (Sonoma)
- Linux
Output of colima status
colima status INFO[0001] colima is running using macOS Virtualization.Framework INFO[0001] arch: aarch64 INFO[0001] runtime: docker INFO[0001] mountType: virtiofs INFO[0001] docker socket: unix:///Users/XXX/.colima/default/docker.sock INFO[0001] containerd socket: unix:///Users/XXX/.colima/default/containerd.sock
Reproduction Steps
- Leave default monitoring of entire $HOME dir
- Leave laptop running for more than 3 days
- Check processlist for memory consumption of fseventsd
Expected behaviour
I would remove $HOME from the defaults or see how docker desktop does this without trashing fseventsd
Additional context
No response
Source: abiosoft/colima