Linux에서 디버그중에 어플이 갑자기 죽는 "ENOSPC: System limit for number of file watchers reached" 오류
해결 1) Linux inotify watcher 한도 증가(권장)
- 현재 값 확인:
shell
# Bash
cat /proc/sys/fs/inotify/max_user_watches
cat /proc/sys/fs/inotify/max_user_instances- 일시 증가(즉시 적용):
shell
# Bash (sudo 필요)
sudo sysctl fs.inotify.max_user_watches=524288
sudo sysctl fs.inotify.max_user_instances=1024- 영구 설정(재부팅 후에도 유지):
shell
# Bash (sudo 필요)
echo 'fs.inotify.max_user_watches=524288' | sudo tee /etc/sysctl.d/99-inotify.conf
echo 'fs.inotify.max_user_instances=1024' | sudo tee -a /etc/sysctl.d/99-inotify.conf
sudo sysctl -p /etc/sysctl.d/99-inotify.conf- 이후 다시: yarn dev:debug 실행
해결 2) Watcher 대신 폴링 사용(대안/즉시 응급처치)
- 한 번만 시험:
shell
CHOKIDAR_USEPOLLING=1 CHOKIDAR_INTERVAL=800 yarn dev:debug- 자주 쓸 거면 Run/Debug 구성의 Environment variables에 CHOKIDAR_USEPOLLING=1, CHOKIDAR_INTERVAL=800 추가