How to find and clear zombie processes w/o rebooting?

Cameron Simpson cs at zip.com.au
Thu Jun 26 01:52:24 UTC 2008


On 25Jun2008 18:33, Daniel B. Thurman <dant at cdkkt.com> wrote:
> Using F8, I have found that Nautilus sometimes hangs and
> runs at 100% CPU.  Force killing Nautilus's drive windows
> was the only way to recover.  I am not sure that force killing
> this drive window is related to the zombie that I founding using
> top.
> I also discovered that my swap was increased to 2GB of 4GB
> and has stayed there ever since.

Zombies are just process slots of exit()ed processes awaiting collection.
They do not consume CPU time or swap space.

> So before I accuse Nautilus as being the zombie process, how
> do I locate it using ps or some other tool to find out what is
> going on and to what process the zombie was?

Zombies are in the Z state. They are exited programs whose parents have
not called wait() to collect the exit status.

> In the same breadth, is there a way to clear zombie processes
> without being forced to reboot the system which would certainly
> remove the zombie process and clear the swap space?

Removing zombies will do NOTHING about your swap space, since they are
not consuming it. (Of course a reboot will clear the swap, as it does
everything else.)

They only way to clear a zombies process slot (which is all a zombie
process actually is) is to find the zombie's parent process (using ps'
"f" (forest) option, for example, or just looking at the PPID column)
and either causing the parent to do a wait() for the zombie if possible,
or to kill the parent (which will cause the zombies to be inherited by
process 1, which will then wait() for it, cleaning it up).

Zombies are essentially untidy but harmless. They are not eating you
machine's brains (ram/swap/cpu).

Cheers,
-- 
Cameron Simpson <cs at zip.com.au> DoD#743
http://www.cskk.ezoshosting.com/cs/

Zombies don't get pumped.       - Jake, in rec.climbing




More information about the fedora-list mailing list