Skip to content

Instantly share code, notes, and snippets.

@Ashkanph
Last active January 28, 2020 07:27
Show Gist options
  • Select an option

  • Save Ashkanph/c17fc988e9d9216137e013f10b681eb1 to your computer and use it in GitHub Desktop.

Select an option

Save Ashkanph/c17fc988e9d9216137e013f10b681eb1 to your computer and use it in GitHub Desktop.
Notes (nodejs, node, npm, gulp, webpack)
  • The error:
Error: ENOSPC: System limit for number of file watchers reached

/etc/sysctl.conf

برای تعیین حداکثر تعداد واچ‌های ان‌پی‌ام

fs.inotify.max_user_watches=524288

// 524288 / 1024= 512 MB of the RAM!

  • And then

sudo sysctl -p


# Which programs are consuming my watches?
sudo find /proc/*/fd -lname anon_inode:inotify | cut -d/ -f3 | xargs -I '{}' -- ps --no-headers -o '%p %U %c' -p '{}' | uniq -c | sort -nr

# or
$ find /proc/*/fd/* -type l -lname 'anon_inode:inotify' -exec sh -c 'cat $(dirname {})/../cmdline; echo ""' \; 2>/dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment