Home > linux > How To: Killing a zombie process

How To: Killing a zombie process

As System Admins, we’ve seen it all and occaissionally we get to see a zombie process or two or three or bunch! What is a Zombie process anyway? Here is a technical description of it followed by mellowed down admin level description of it…

On Unix and Unix-like computer operating systems, a zombie process or defunct process is a process that has completed execution but still has an entry in the process table. This entry is still needed to allow the process that started the (now zombie) process to read its exit status.

The term zombie process derives from the common definition of zombie—an undead person. In the term’s colorful metaphor, the child process has died but has not yet been reaped. Also, unlike normal processes, the kill command has no effect on a zombie process.

Re-read the last sentence there…a zombie process cannot be killed!  Some claim that it can be and luckily I’ve been able to kill a few myself, however, for the most part they’re impossible to kill and the only thing that clears that up from the process table is actually rebooting your system.

If you would like to try killing them first, try out the following quickies:

# kill -9 `ps aux | awk '{ print $8 " " $2 }' | grep -w Z`
# ps aux | awk ‘{ print $8 ” ” $2 }’ | grep ‘Z’ |awk ‘{print $2}’ |xargs kill -9

If that don’t do it, then leave it alone. Zombie processes do not consume resources. However, they do get annoying if they continue to grow in the process stable so at the point, just reboot the server!

Categories: linux Tags:
  1. Anonymous Coward
    October 10th, 2010 at 04:43 | #1

    Reboot may be the simplest way to get rid of zombies, but it can also be done if parent process of zombie is killed/restarted. That may not be always possible, but in my experience I got rid of 90% zombies this way. Having desktop linux, sometimes full logout/login cycle did the job (if zombie parent crashed).

  2. partha kakati
    November 16th, 2010 at 11:53 | #2

    the explaination is fairly good enough but it should be a little bit more explanetory . please try to give more details of those answers instead of coopying just from wikipedia or other resources

  1. October 11th, 2010 at 01:16 | #1