On Fri, Jan 12, 2001 at 11:29:21AM -0700, Ashley M. Kirchner <[EMAIL PROTECTED]> wrote:
|     This may have been beaten to death by now, but I'm still having
| problems with too many open files.  RH7 sets file-nr to 4096, which my
| system seems to hit every 2 weeks or so, requiring a restart (or
| adjustment of file-nr).  Is there any way to find out what's causing
| this leak?  As in, which program is keeping this files open?  I don't
| want to go into 'why' since I'm afraid I'll be opening a whole case of
| worms.  However I'd like to find out what's causing these, and a
| possible solution.

I'd scan /proc/n/fd where n is the pid.

For example:

        cd /proc
        for pid in [0-9]*
        do  ls $pid/fd | wc -l | awk -v pid=$pid '{print pid ": " $0}'
        done | sort -n +1

That should get you a listing of pids and the number of open files they
have, sorted by number of files so your culprit(s) should be at the
bottom of the list. Then look at /proc/n/cmdline for values of n
matching the last few pids in the listing. (I've tested that script
above - it works.)

Cheers,
-- 
Cameron Simpson, DoD#743        [EMAIL PROTECTED]    http://www.zip.com.au/~cs/

Every particle continues in its state of rest or uniform motion in a straight
line except insofar as it doesn't.      - Sir Arther Eddington



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to