Every process has a parent process and the parent processes are responsible for creating (forking) child processes and cleaning them from the process table after they finished their execution. When a process finishes its execution it leaves an exit status to be sent to the parent process, then it becomes a zombie.
In some cases, a process can not be cleaned from the Linux OS process table properly after finishing the execution. An increasing number of defunct processes may lead to a system outage because the size of the process table is limited.
If a zombie process exists, top command should show the number
of them on the top/right corner of the screen:
top - 11:24:49 up 3 days, 18:23, 1 user, load average: 7.04, 6.72, 6.39
Tasks: 304 total, 3 running, 297 sleeping, 0 stopped, 4 zombie
........
To find a defunct process ps command can be used:
# ps -ef |grep -v grep |grep "Z\|defunct"
102 1485669 2953018 0 07:07 ? 00:00:00 [ssh] <defunct>
........
To clean it, SIGCHLD signal should be sent to the parent process.
# kill -s SIGCHLD 2953018
if sending a SIGCHLD signal doesn't work, you should kill/restart the parent
process.
# kill -9 2953018
Comments
Post a Comment