resource leak

Robert Watson rwatson at FreeBSD.org
Wed Oct 1 17:56:30 UTC 2008


On Wed, 1 Oct 2008, Gary Palmer wrote:

>> Periodically logging "ps -auxw" output to a file would be useful, as 
>> ideally you'd gradually see the list get longer and longer over time; it's 
>> possible you have many zombie processes as a result of a parent which is 
>> not reaping its children (calling waitpid(2) or its friends).
>
> "ps alxw" may be of interest in addition to "ps auxw" as it displays what 
> the processes are waiting on.  It could conceivably be a problem of some 
> kind at the filesystem level.  I've seen situations before where a problem 
> escalates to the point where "ls /" hangs, and at that point you're stuck 
> with an unresponsive box.

If you want an even greater level of detail than ps -l, you can use procstat 
-k to generate kernel stack traces for all user/kernel threads.  Wait channels 
are very useful, but they only tell you what the code that invoked the wait 
thinks it is for, not how that code was reached.  A classic example is waiting 
on an exhausted UMA zone -- you get a uma wait channel, but no indication of 
what subsystem performed the memory allocation...  This required FreeBSD 7.1 
and higher, however.  (Obviously, the same can be done easily using DDB, but 
that's hard on a box without a serial console, and requires interrupting the 
flow of the operating system, compiling with DDB, etc).

Robert N M Watson
Computer Laboratory
University of Cambridge


More information about the freebsd-stable mailing list