How to view zombie processes on Linux systems, how many zombie processes are counted?
#ps-ef | grep defunct
Or looking for a process with a status of Z, Z is the meaning of the zombie process representing zombie process.
In addition, using the top command to view a column is S, if the status of Z indicates that it is a zombie process.
tasks:95 Total, 1 running, 94 sleeping, 0 stopped, 1617 zombie
The zombie process is also counted in the top command. or use the following command:
Ps-ef | grep defunct | Grep-v grep | Wc-l
How to kill the zombie process?
The general zombie process is hard to kill directly, but you can kill the zombie dad. After the parent process dies, the zombie process becomes the "orphan process", and the adoptive process init,init will always be responsible for cleaning up the zombie process. All of the zombie processes it produces also disappear.
PS-E-O Ppid,stat | grep Z | Cut-d ""-f2 | Xargs kill-9
This article is from the "technical Discrimination" blog, please be sure to keep this source http://emg2012.blog.51cto.com/3705315/1615347
Server generates a lot of zombie processes