Killing Zombie process!

Cameron Simpson cs at zip.com.au
Mon Oct 22 23:04:57 UTC 2007


On 23Oct2007 03:53, smitha rao <smitharao1980 at gmail.com> wrote:
| I was wondering if i can kill all the zombie process in my server in one
| shot.

You can't kill zombies - they are already dead. That may sound like
humour, but it is also the literal truth - that's why zombie processes
are called zombies.

A zombie is a child process which has exited, but not been waited for by
its parent process - a formal action involving the wait() system call.
A zombies process is _nothing_ more than a slot in the process table
kept around to store the exit status of the child when the parent
process gets around to calling wait(). Since it's just a process slot,
you do not need to worry about them consuming resources - you need tens
of thousands of these to exhaust your process table. Their main downside
is filling ps listings with noise, but ps listings are rarely needed in
real life.

Seeing a lot of zombies is normally an indication of loose programming
practices by the author of the parent process. A lot of careless
xinitrc/xsession scripts have this flaw, but they are not alone.

A zombie will _only_ go away when its parent process calls wait(),
obtaining the exit status and freeing the process slot. If the parent
exits, the zombie is inherited by process 1 (init), which will wait()
for the zombie and clean it up.

If all the zombies are children of a single parent, killing the parent
will cause the zombies to be reaped by process 1. But killing the parent
may not be a good thing to do; your call.

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

Hit the button Chewie!  - Han Solo




More information about the redhat-list mailing list