<div dir="ltr">This shell snippet will give you a per-PID count of inotify watches:<div><br></div><div>find /proc -type l -lname &#39;anon_inode:inotify&#39; 2&gt;/dev/null | grep -v task | cut -d &#39;/&#39; -f 3 | sort | uniq -c<br></div><div><br></div><div>This works by finding all inotify watches (which are represented as an fd for the process, and the proc filesystem exposes them as a symlink to &#39;anon_inode:inotify&#39;) then grabbing the PIDs, sorting and counting the repetitions.  `ps` should help you figure out the process from the PID :)</div><div><br></div><div>Yes, you can increase your inotify cap: it doesn&#39;t take memory immediately, but each one *used* is 1k bytes of kernel memory.  The cap is just there to prevent inotify from consuming all your memory.</div><div><br></div><div>David</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 11, 2016 at 7:23 AM, leam hall <span dir="ltr">&lt;<a href="mailto:leamhall@gmail.com" target="_blank">leamhall@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Trying to understand inotify on 2.6.x kernels. Have started seeing issues with the maximum number of kernel watches (default 8912) being hit be no idea how to look into the issue to see exactly what is using exactly how many. <br><br></div>From some reading it seems that doubling the max number of watches works but takes out kernel memory. Does anyone have experience/knowledge on this?<span class="HOEnZb"><font color="#888888"><br><br></font></span></div><span class="HOEnZb"><font color="#888888">Leam<br><br clear="all"><div><div><div><br>-- <br><div><div><a href="http://leamhall.blogspot.com/" target="_blank">Mind on a Mission</a></div></div>
</div></div></div></font></span></div>
<br>_______________________________________________<br>
Ale mailing list<br>
<a href="mailto:Ale@ale.org">Ale@ale.org</a><br>
<a href="http://mail.ale.org/mailman/listinfo/ale" rel="noreferrer" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
See JOBS, ANNOUNCE and SCHOOLS lists at<br>
<a href="http://mail.ale.org/mailman/listinfo" rel="noreferrer" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div>David Tomaschik<br>OpenPGP: 0x5DEA789B<br><a href="https://systemoverlord.com" target="_blank">https://systemoverlord.com</a><br><a href="mailto:david@systemoverlord.com" target="_blank">david@systemoverlord.com</a></div></div></div>
</div>