How do I find out what inotify watches have been registered?

前端 未结 7 2113
渐次进展
渐次进展 2021-01-30 05:14

I have my inotify watch limit set to 1024 (I think the default is 128?). Despite that, yeoman, Guard and Dropbox constantly fail, and tell me to up my inotify limit. Before do

7条回答
  •  自闭症患者
    2021-01-30 05:48

    The following terminal command worked perfectly for me on my Ubuntu 16.04 Machine:

    for foo in /proc/\*/fd/*; do readlink -f $foo; done |grep inotify |cut -d/ -f3 |xargs -I '{}' -- ps --no-headers -o '%p %U %a' -p '{}' |uniq -c |sort -n
    

    My problem was that I had a good majority of my HDD loaded as a folder in Sublime Text. Between /opt/sublime_text/plugin_host 8992 and /opt/sublime_text/sublime_text, Sublime had 18 instances of inotify while the rest of my programs were all between 1-3.

    Since I was doing Ionic Mobile App development I reduced the number of instances by 5 by adding the large Node.js folder "node_modules" to the ignore list in the Sublime settings.

    "folder_exclude_patterns": [".svn", ".git", ".hg", "CVS", "node_modules"]
    

    Source: https://github.com/SublimeTextIssues/Core/issues/1195

提交回复
热议问题