How to clear defunct processes?? | Unix Linux Forums | HP-UX

  Go Back    


HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V.

How to clear defunct processes??

HP-UX


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 01-09-2013
SurajR SurajR is offline
Registered User
 
Join Date: Jan 2013
Last Activity: 9 January 2013, 12:17 PM EST
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
How to clear defunct processes??

How to find out and clear the 'defunct' processes at OS and DB level ..??
Sponsored Links
    #2  
Old 01-09-2013
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 31 October 2014, 9:36 PM EDT
Location: Saskatchewan
Posts: 19,745
Thanks: 832
Thanked 3,375 Times in 3,162 Posts
It's not the system that's letting them accumulate, it's whatever program creating them that is. They still belong to a living process, one which hasn't called wait() for them. That's a bug.

If you restart that daemon, causing it to quit and reload, those zombie processes will default their ownership back to INIT, which will handle them properly.
Sponsored Links
    #3  
Old 01-09-2013
Don Cragun's Avatar
Don Cragun Don Cragun is online now Forum Staff  
Moderator
 
Join Date: Jul 2012
Last Activity: 31 October 2014, 11:35 PM EDT
Location: San Jose, CA, USA
Posts: 4,939
Thanks: 186
Thanked 1,657 Times in 1,406 Posts
Quote:
Originally Posted by SurajR View Post
How to find out and clear the 'defunct' processes at OS and DB level ..??
You get a defunct process (or zombie) when that process exits and its parent does not gather its exit status (see the man page for the wait() system call). If, and only if, the parent exits before its children's exit status is collected, a system process (usually named init) will gather the exit status of abandoned children.

This is the way it works on any UNIX or Linux system, not just HP/UX.

Last edited by Don Cragun; 01-09-2013 at 01:22 PM.. Reason: clarification
    #4  
Old 01-09-2013
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
 
Join Date: Feb 2004
Last Activity: 31 October 2014, 2:57 PM EDT
Location: NM
Posts: 10,258
Thanks: 285
Thanked 803 Times in 747 Posts
PS: you cannot use
Code:
kill -9

on a defunct (zombie) process, because the process is already dead.

The name zombie comes from those cheap 1960's movies like 'Day of the Dead' - except in those movies you could apparently 'kill' those zombies.... you cannot kill something that is already dead in UNIX, it ain't the movies.
The Following 3 Users Say Thank You to jim mcnamara For This Useful Post:
RavinderSingh13 (11-26-2013), Scott (01-09-2013), Yoda (01-09-2013)
Sponsored Links
    #5  
Old 01-09-2013
Yoda's Avatar
Yoda Yoda is offline Forum Advisor  
Jedi Master
 
Join Date: Jan 2012
Last Activity: 30 October 2014, 6:50 PM EDT
Location: Galactic Empire
Posts: 3,387
Thanks: 235
Thanked 1,209 Times in 1,135 Posts
I have a question: You mentioned that the zombie process is already dead. But this process entry remains in the process table. I read somewhere that the problem would grow serious under heavier loads and OS may run out of Process ID numbers! Is this situation possible or does init invokes wait system call all the time and reap any zombies?
Sponsored Links
    #6  
Old 01-09-2013
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 31 October 2014, 9:36 PM EDT
Location: Saskatchewan
Posts: 19,745
Thanks: 832
Thanked 3,375 Times in 3,162 Posts
Zombies remain in the process table for a reason: There's still information there about how the program quit, which their parent is supposed to get via the wait() or other related calls. Once it does, they're deleted from the table.

init can't wait for processes that don't belong to it. If it did, that could cause problems with processes that were handling their children -- if init handles the dead process first for whatever reason, the proper parent will be stuck waiting for it.

So, only the owner of a process is allowed to wait() for it.

So a process that accumulates an endless amount of zombies is a serious problem. There may be limits in place preventing one user from running too many simultaneous processes, but often these limits haven't been specified for daemons. It's possible for the process table to be filled up, yes.

The proper way to deal with zombies is to fix the bug in the program that's allowing zombies to accumulate. The short-term solution is to kill their parent -- all the zombies will default back to init, which will clean them up.

Last edited by Corona688; 01-09-2013 at 04:37 PM..
The Following User Says Thank You to Corona688 For This Useful Post:
Yoda (01-09-2013)
Sponsored Links
    #7  
Old 01-09-2013
methyl methyl is offline Forum Advisor  
Advisor
 
Join Date: Mar 2008
Last Activity: 18 April 2014, 5:13 AM EDT
Posts: 6,396
Thanks: 287
Thanked 673 Times in 642 Posts
In HP-UX zombie processes which are waiting for a hardware resource will not die without a reboot.

Can you post an example process tree?
How many zombie processes do you have on a bad day? Do they ever disappear without a reboot?
What database engine are you using, and do you have a simple explanation for the zombie processes (like users disconnecting untidily)?
The Following User Says Thank You to methyl For This Useful Post:
Corona688 (01-10-2013)
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
defunct processes? steadyonabix UNIX for Advanced & Expert Users 2 05-21-2010 10:07 AM
Defunct Processes trokia88 AIX 6 09-09-2008 06:08 PM
Question about defunct processes EMCSANMAN UNIX for Dummies Questions & Answers 1 02-08-2008 12:03 PM
how do I kill defunct processes? csaunders Solaris 10 01-28-2008 03:49 PM
<DEFUNCT> Processes cuppjr UNIX for Dummies Questions & Answers 4 02-26-2001 05:55 PM



All times are GMT -4. The time now is 11:56 PM.