Impact of Reaping Zombie Processes in Solaris

processsolariszombie-process

I will execute following command for reaping zombie

 /usr/bin/preap $(ps -ef | grep defunct | grep -v grep | awk '{ print $2 }' | xargs)

Is there any service impact of this approach ?

Best Answer

If you reap a zombie before its parent, you lose whatever effect the reaping would have in the parent. This is obviously application-dependent.

There is very little reason to actively go and reap zombies. Some operating systems don't let you do it, short of manually ptracing the parent process and causing it to execute a waitpid system call. Solaris offers a preap utility, but the only case when you should use it is when a program is misbehaving and filling the process table with zombies.

Related Question