Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Zombie Processes

Status
Not open for further replies.

porsche

Technical User
Jun 15, 2000
2
IE
Hi<br><br><br>can anybody help me to find out the process ID's of zombie processes so they can be killed?<br><br><br>thanks<br><br><br><br>John
 
John,<br><br>You probably don't need to kill them.<br><br>A zombie process (and forgive me if you know this already) is created when Process A starts Process B and then A exits before B. B then exits.<br><br>Unix keeps a place in the process table for the return code of B - not realizing that no one is there to read it.<br><br>The only resource these take up is a slot in the process table. If that's a problem for you then either:<br><br>1 - You have a stunning number of zombies (look at what is leaving them around)<br><br>2 - You have nowhere *near* enough space in your process table (get your kernel reconfigured to allow more space)<br><br>You can clear the entry in the process table by typing <FONT FACE=monospace><b>wait [pid]</font></b> - don't use kill - too easy to kill the wrong thing.<br><br>from the ps man page &quot;A process that has exited and has a parent, but has not yet been waited for by the parent, is marked &lt;defunct&gt;...&quot; so you can get the PID's from there. <br><br>But wait for them - don't kill them. <p>Mike<br><a href=mailto:michael.j.lacey@ntlworld.com>michael.j.lacey@ntlworld.com</a><br><a href= Cargill's Corporate Web Site</a><br>
 
I didn't get that quite right - this is from the exit(2) manpage:<br><br><FONT FACE=monospace><b>If the parent process of the calling process is not executing a wait(), wait3(), or waitpid(), and does not have SIGCLD set to SIG_IGN, <i><font color=red>(true if the parent has terminated you notice -- mike)</i></font> the calling process is transformed into a zombie process. A zombie process is a process that only occupies a slot in the process table.&nbsp;&nbsp;It has no other space allocated either in user or kernel space.&nbsp;&nbsp;Time accounting information is recorded for use by times() (see times(2)). <br><br>The parent process ID is set to 1 for all of the calling process's existing child processes and zombie processes.&nbsp;&nbsp;This means the initialization process (proc1) inherits each of these processes.</font></b><br><br>Anyway - the bottom is, as I said before, don't worry about them generally.<br> <p>Mike<br><a href=mailto:michael.j.lacey@ntlworld.com>michael.j.lacey@ntlworld.com</a><br><a href= Cargill's Corporate Web Site</a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top