cancel
Showing results for 
Search instead for 
Did you mean: 

meaning of ps output

SOLVED
Go to solution
Victor_5
Trusted Contributor

meaning of ps output

One line of 'ps -t ttypf' says

PID TTY TIME COMMAND
17866 ttypf 0:00

What is the meaning of ?
8 REPLIES
Marcin Wicinski
Trusted Contributor

Re: meaning of ps output

Hi,

defunct process = zombie process
A defunct process is a child process whose parent died without doing a wait on the child. It takes up no resources other than an entry in the process table. The only way to remove this from the process table is
to reboot the system.

Later,
Marcin Wicinski
Jared Westgate_1
Valued Contributor
Solution

Re: meaning of ps output

Hello Shawn,

A defunct (or zombie) process is a child process whose parent did not execute a wait for the child. Depending on how the defunct is created, it CAN sometimes be cleaned up.

For instance, I have Oracle concurrent managers (Oracle Apps), that occasionally put out defunct processes. To clean up these defuncts, all I have to do is bounce the concurrent managers.

I'm not positive, but apparently a defunct can result from a parent process that is still alive. When that parent process is cleaned up, it cleans up its defunct children. I'm not sure of the exact internal workings (hopefully another guru can fill me in), but this is the only thing I can figure.

I guess what I'm getting at is that as a relative newbie to the HP-UX world, I've heard countless times that you have to reboot to clear out a defunct; but, that is not neccessarily true. In at least some cases, defuncts can be cleaned up by cleaning up the process that created them.

Hope this helps,

Jared
linuxfan
Honored Contributor

Re: meaning of ps output

Hi Shawn,

The manpage of ps tells you what a defunct process is
/Begin/
a process that has exited and has a parent, but has not yet been waited for by the parent, is marked (see zombie process in exit(2))
/End/

Doing a "man exit" and looking for zombie, will give you more information about defunct or zombie processes.

Don't think, there is a simpler explanation then what Marcin has already given.
And yes it doesn't take up any resources other than a slot in the process table.

But if you have a lot of defunct process, then that needs more investigation.

-HTH
Ramesh
They think they know but don't. At least I know I don't know - Socrates
Bill Thorsteinson
Honored Contributor

Re: meaning of ps output

Try ps -ft ttypf to find out which process is the parent.
If the parent is 1, then you may need to bounce the
server to clear it. If not, then it should clear up when
the parent exits.

If you have defunct processes hanging around for a
long time see if you can find a patch for the parent
process.
Magdi KAMAL
Respected Contributor

Re: meaning of ps output

Hi Shawn,

Ooups, is a ZOMBIE process.

Attention, these process are not live nor die. So that, they did not free their resources and you can have serious problems having such processes. Some of them could be ( in a very small situations ) killed by the system, but most of time you will need a system reboot to erase them.

Possible cause:

Application miss programming.

have a look on my thread which explains :
-Why you have Zombies.
-How to avoid Zombies.

http://forums.itrc.hp.com/cm/QuestionAnswer/1,1150,0xa26e87dc4d7dd5118ff00090279cd0f9,00.html

Magdi
Wodisch
Honored Contributor

Re: meaning of ps output

Hello Shawn,


EVERY process becomes a zombie (output of "ps -el"
show a "Z" in the state column), when it exits, regardless
wether by being killed or by calling "exit()" or something
else. It stays in that state until its parent process has
received the signal "Death of a Child" (SIGCHLD). Then
the zombie disappears. Its a normal state!
The ONLY way to not become a zombie, is for the parent
to block that signal SIGCHL before calling "fork()".

A "runaway" process is just one, which eats up lots of
cpu time without stopping eventually. This is usually
considered to a bug, i.e. abnormal.

Just my $0.02,
Wodisch
Magdi KAMAL
Respected Contributor

Re: meaning of ps output

Hi again Shawn,

I experienced just before a command to release Zombies by the following command :

#kill -HUP

While :
1. The process id stand for Zombie process ID.
2. parentProcessID is the Parent Process ID.
3. parentProcessID is different from any system PID ( only if it's a user Parent process ).

Notice :
But I'm not sure if the resources belonging to the killed Zombie is back to the system ?.

Magdi

Victor_5
Trusted Contributor

Re: meaning of ps output

I will have a try when I get a chance later, thanks a lot, Magdi!