Killing a zombie process[PRD]

Dear All,

I have checked so many post about killing Zombie process.

Most of the cases, everyone suggested to "reboot" the system, as "kill -9/-15 zombie" may not work!

My concern is:
If the system is a Production server then what to do?[you can't reboot the system!]

Regards,
Sapy.

"kill -9/-15" won't work. There is actually no point in trying to kill a zombie process as it is already "dead" anyway.

1 Like

So what do you sugest then, as it is a Production Server!

preap PID

will do the trick.

2 Likes

As jlliagre mentioned, zombies are already dead. They consume no resources aside from their entry in the process table. Whatever memory they were using has been returned to the system. Whatever descriptors they held open have been closed. Etcetera.

A zombie occurs when a process does not collect the exit information of a child. If you are seeing a lot of zombies, then you have a poorly coded program running on your system. If you kill this program (the parent of the zombies), the zombies will be adopted by init (PID 1) and it will take care of them.

So, a less drastic workaround than rebooting the system would be to restart the application that created those zombies. I don't use solaris, but from what I just read, preap as suggested tamitot allows you to avoid a restart of even a single process. Best solution of course is to fix the program which spawned the zombies in the first place (although I realize that sometimes this is not possible).

Regards,
Alister

1 Like

I think this link will help
Less known Solaris features: Getting rid of Zombies - c0t0d0s0.org

1 Like

Thanks Alister and Tamitot for clearing my doubt. I will definitely try to fix those program which created the zombies in next CR.

Thank you hard_Revenge for that link. The link is really good, it shows how the 'preap' command works [with example! :)]

1 Like