the zombie (or defunct) processes are dead processes that still apear in the process table, usually because of bugs and coding errors. A zombie process remains in the operating system and does nothing until the parent process determines that the exit status is no longer needed.
When does a process turn into a zombie?
Normally, when a process finishes execution, it reports the execution status to its parent process. Until the parent process decides that the child processes exit status is not needed anymore, the child process turns into a defunct or zombie process. It does not use resources and it cannot be schuduled for execution. Sometimes the parent process keeps the child in the zombie stateto ensure that the future children processes will not receive the same PID.
You can find the zombie processes with ps aux | grep Z. The processes with Z in the STATE field are zombie processes:
$ ps aux | grep Z
http://www.geekride.com/zombie-process-defunct-linux
Killing a Zombie Process:
Well, before taking any decision of killing the Zombie process, you should wait, as it is possible that the parent process is intentionally leaving the process in a zombie state to ensure that future children that it may create will not receive the same pid. Or perhaps the parent is occupied, and will reap the child process momentarily.
If that didn’t happen then you can send a SIGCHLD signal to the parent process of zombie which will instruct parents to reap their zombie children.
# kill -s SIGCHLD <PPID>
or kill -17 <PPID>
Even if this don’t work, then the last option you will have is to kill the parent process. You can easily find out the parent’s process ID with this command:
# ps aux -eo ppid | grep <Zombie Process ID>
# kill -9 <PPID>
So when a Zombie process loses it’s parent process, it becomes orphan and adopted by “init”. Init periodically executes the wait system call to reap any zombies with init as parent.
Also refer to http://www.geekride.com/zombie-process-defunct-linux
Read full article from What are the Zombie and the Orphan Processes and how to kill them? | LinuxG.net
When does a process turn into a zombie?
Normally, when a process finishes execution, it reports the execution status to its parent process. Until the parent process decides that the child processes exit status is not needed anymore, the child process turns into a defunct or zombie process. It does not use resources and it cannot be schuduled for execution. Sometimes the parent process keeps the child in the zombie stateto ensure that the future children processes will not receive the same PID.
You can find the zombie processes with ps aux | grep Z. The processes with Z in the STATE field are zombie processes:
$ ps aux | grep Z
http://www.geekride.com/zombie-process-defunct-linux
Killing a Zombie Process:
Well, before taking any decision of killing the Zombie process, you should wait, as it is possible that the parent process is intentionally leaving the process in a zombie state to ensure that future children that it may create will not receive the same pid. Or perhaps the parent is occupied, and will reap the child process momentarily.
If that didn’t happen then you can send a SIGCHLD signal to the parent process of zombie which will instruct parents to reap their zombie children.
# kill -s SIGCHLD <PPID>
or kill -17 <PPID>
Even if this don’t work, then the last option you will have is to kill the parent process. You can easily find out the parent’s process ID with this command:
# ps aux -eo ppid | grep <Zombie Process ID>
# kill -9 <PPID>
So when a Zombie process loses it’s parent process, it becomes orphan and adopted by “init”. Init periodically executes the wait system call to reap any zombies with init as parent.
Q. Why I can’t kill a Zombie process with “kill” command ?
A. Zombie process is already dead, so killing them with “kill -9″ won’t help at all.
A. Zombie process is already dead, so killing them with “kill -9″ won’t help at all.
Q. Is it bad to have Zombie processes on your system ?
A. Well, as Zombie processes are not taking any resources of your system, leaving a small entry in process table, it’s not at all harmful to have Zombie processes in your system, but it may hurt you sometime under heavy load. So, it’s always better not to have them.
A. Well, as Zombie processes are not taking any resources of your system, leaving a small entry in process table, it’s not at all harmful to have Zombie processes in your system, but it may hurt you sometime under heavy load. So, it’s always better not to have them.
Q. Is Zombie process different from an Orphan process ?
A. Yes, Zombie is something which is already dead, but Orphan processes are those whose parents are dead.
A. Yes, Zombie is something which is already dead, but Orphan processes are those whose parents are dead.
Also refer to http://www.geekride.com/zombie-process-defunct-linux
Read full article from What are the Zombie and the Orphan Processes and how to kill them? | LinuxG.net
No comments:
Post a Comment