What is a zombie process?


Zombies are dead processes.  You cannot kill the dead.  All processes eventually die, and when they do they become zombies.  They consume almost no resources, which is to be expected because they are dead!  The reason for zombies is so the zombie's parent (process) can retrieve the zombie's exit status and resource usage statistics.  The parent signals the operating system that it no longer needs the zombie by using one of the wait()system calls.
When a process dies, its child processes all become children of process number 1, which is the init process.  Init is ``always'' waiting for children to die, so that they don't remain as zombies.
If you have zombie processes it means those zombies have not been waited for by their parent (look at PPID displayed by ps -l).  You have three choices: Fix the parent process (make it wait); kill the parent; or live with it.  Remember that living with it is not so hard because zombies take up little more than one extra line in the output of ps.


One more Explanation : 

When a process finishes execution, it will have an exit status to report to its parent process. Because of this last little bit of information, the process will remain in the operating system’s process table as a zombie process, indicating that it is not to be scheduled for further execution, but that it cannot be completely removed (and its process ID cannot be reused) until it has been determined that the exit status is no longer needed.

When a child exits, the parent process will receive a SIGCHLD signal to indicate that one of its children has finished executing; the parent process will typically call the wait() system call at this point. That call will provide the parent with the child’s exit status, and will cause the child to be reaped, or removed from the process table

Ways to kill Zombie Process 
 
Top
Maintained By Amit Maheshwari