How to get rid of zombie process?

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat How to get rid of zombie process?
# 1  
Old 06-05-2013
How to get rid of zombie process?

Hi,

How to get rid of Zombie Process,
Kill -9 PID does not seem to be permanent solution,

your help will be Appreciated.

Thanks
# 2  
Old 06-05-2013
You cannot get rid of a zombie with kill and a termination signal. It is already dead, to keep the metaphor going.

Zombies are un-waited for child processes.

Instead find the parent of the process, and issue
Code:
kill -SIGCHLD [parent_pid]

This is not necessarily safe nor will it always work, if you want the parent to keep on running. The parent process signal mask could be set to terminate on SIGCHLD or do nothing. The default action for SIGCHLD is ign. The next step is to
Code:
kill -SIGTERM [parent_pid]

if the parent can be killed off.

Zombies are the result of poor coding practices.
# 3  
Old 06-05-2013
As jim stated, a zombie process is already dead. It has already exited. Any files it opened have been closed. Any memory it allocated has been freed. Aside from its entry in the process table, its not consuming any resources. So, if you only have a few of them, it's probably not worth killing the parent or rebooting.

Again, as jim stated, zombies are the result of a parent not looking after its children. If the parent's code is under your control, you should improve it with the appropriate wait calls. If it is not, you should file a bug report with the author.

Regards,
Alister
# 4  
Old 06-05-2013
even killing Parent_PID, is not working,
any other work around to make this work..

Thanks
# 5  
Old 06-05-2013
If you killed the parent and it has exited, and if the zombie process is still hanging around, then it is not a zombie process (which wouldn't suprse me because "zombie" is an often misused term).

Provide two reports of the "zombie" processes and their parents, one before and one after killing a parent, using a ps format which at the very least includes uid, pid, ppid, and stat. Also, include the output of the id command when run by the same user that kills the parent.

Regards,
Alister

Last edited by alister; 06-05-2013 at 11:38 AM..
# 6  
Old 06-05-2013
We need to see the output of ps -ef showing the parent and the zombie(s). If you actually terminated the parent, the zombies would also "go away" in a few minutes. If you terminated another non-parent then, no, the zombies will remain.
# 7  
Old 06-05-2013
These are the outputs requested, i have killed the PPID, will post the out puts again if the Zombie process comes up again,

Code:
[cmsprod@drcmsapp303 lib]$ id
uid=2049(cmsprod) gid=2049(cmsprod) groups=200(oinstall),2049(cmsprod),4061(varlogs)
[cmsprod@drcmsapp303 lib]$ ps axo stat,ppid,pid,comm | grep -w defunct
Z    13464 19966 java <defunct>
[cmsprod@drcmsapp303 lib]$ kill -SIGCHLD 13464
[cmsprod@drcmsapp303 lib]$ kill -SIGTERM 13464
[cmsprod@drcmsapp303 lib]$ ps axo stat,ppid,pid,comm | grep -w defunct
[cmsprod@drcmsapp303 lib]$

Thanks

Last edited by jim mcnamara; 06-05-2013 at 01:38 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Zombie process

What is the overhead associated with zombie process?Is it running out of process-ID?:confused: Since some information is stored in process table.. Thanks in Advance (4 Replies)
Discussion started by: jois
4 Replies

2. Solaris

How to Kill Zombie Process

Dear Bos, I have one server,everday if I check with command TOP always present zombie,like below: last pid: 4578; load averages: 0.15, 0.11, 0.13 07:56:15 298 processes: 295 sleeping, 1... (10 Replies)
Discussion started by: fredginting
10 Replies

3. AIX

zombie process

Is there an equivilant to the preap command in AIX that would allow me to get rid of a zombie process. I am new to AIX, moving over from Solaris and in the past I have been able to preap the pid on the defunct process to clean them up. I have looked around and the best I can see is that it may... (3 Replies)
Discussion started by: sboots
3 Replies

4. Solaris

zombie process

dear friends, in an interview they asked me what is zombie process. how we can identifying these process.if can you kill all zombie process. (8 Replies)
Discussion started by: sijocg
8 Replies

5. Shell Programming and Scripting

Zombie process

Hi I need help because I don't know if it is possible to add a find inside a cat. like I have a file with the pid of the process that use to became zombie. And I have the same pid stored in the var (pid1) now, I have no clue how to check if the the find finds the pid or even if it's... (2 Replies)
Discussion started by: ruben.rodrigues
2 Replies

6. Linux

How to kill zombie process

I have RHES4 machine with VRTSralus - Backup Exec agent installed there and running as a service. The agent hiccups sometimes and turns into defunct state. The problem is that I cannot kill it anyway., it stays there forever until the machine is rebooted. I wonder if anyone had such an experience... (1 Reply)
Discussion started by: will_mike
1 Replies

7. Linux

zombie process

Hi What is the command to find only the zombie processes?? How to write the code in C to fetch the no. of zombie processes?? Thanx (5 Replies)
Discussion started by: jeenat
5 Replies

8. Programming

how to handle a zombie process

hi! i am writing a c program which has the following structure: main() { child1 child1.1 child2 child2.1 } the child1.1 and 2.1 are becoming zombies... how can i handle this... thanx (1 Reply)
Discussion started by: mridula
1 Replies

9. UNIX for Advanced & Expert Users

Zombie process

I would like to create a zombie process so that I can test monitoring software functionality. Any techniques? (2 Replies)
Discussion started by: swhitney
2 Replies

10. UNIX for Dummies Questions & Answers

Zombie process

How do i kill a zombie process. Is it that only root can kill a zombie process. (8 Replies)
Discussion started by: orca
8 Replies
Login or Register to Ask a Question