Too many open files

Kurt Jaeger lists at opsec.eu
Mon Mar 26 08:56:41 UTC 2012


Hi!

> >  From knowing that you have too many files open you can increase the
> > maxfile numbers - but if you want to know what uses them try this -
> >
> > lsof -n | awk '{print $2 "\t" $1}' | sort | uniq -c | sort

On my system, it shows interesting numbers for firefox-instances:

3895 4150       firefox-b
4160 72958      firefox-b
4240 3594       firefox-b
4320 4232       firefox-b
4431 89391      firefox-b

This seems to come from threads, where lsof shows the same
descriptor as open for multiple times, even if it comes from the
same process memory.

For example for pid 4232:

lsof -n | grep icon-theme.cache | grep 4232 | wc -l

firefox-b  4232         pi  txt     VREG              0,102              10784  924293 /usr/local/share/icons/hicolor/icon-theme.cache

This happens on 8.1-REL-p5 amd64. So the method is not fail-safe
for the real number of open files.

-- 
pi at opsec.eu            +49 171 3101372                         8 years to go !


More information about the freebsd-stable mailing list