It can be a case when there are too many zombie processes on the system, and there are no sufficient resources available to spawn more processes. Let's see how to deal with such a situation:
It will provide output like below:
For the above ex:
And you are done!
How to check zombie processes?
- top, a command line utility (which comes by default with most of the Linux distributions) can tell about the zombie processes.top
It will provide output like below:
How to get the PID of a zombie process?
There are multiple ways to check PID of a Zombie process, here we are using ps command (in-built command in most of the Linux distributions)
ps axo stat,ppid,pid,comm | grep -w defunct
Above command will provide all the pid's (Process IDs) and ppid (Parent Process ID's) of all zombie processes.
Kill all Zombie Processes
To kill the zombie process, we have to tell the respective parent process to rip its child process as below.kill -CHLD <PPID>
For the above ex:
kill -CHLD 17807
And you are done!
0 comments:
Post a Comment