Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to kill a zombie process or find it's parent process on a Mac using the Terminal?

share|improve this question
possible duplicate of how to kill process in Mac OS X and not have it restart on its own – soandos Feb 16 '12 at 8:13
@soandos Not a duplicate, as that topic isn't about zombies. None of the kill signals work for zombies IIRC. I've had this happen before. – Daniel Beck Feb 16 '12 at 9:03
Usually one can kill zombies if the parent process is known but this requires killing that one too, which is not always a pleasant choice. Therefore I am wondering if there is another solution to this. – eFrane Feb 16 '12 at 10:45
up vote 12 down vote accepted

Hack Saw says:

Sadly, it appears that killing of zombies is all about killing the parent, and if the parent is /sbin/launchd, you can kill it only with rebooting.

It would be a Very Bad Idea to kill launchd, but you can tell it to HUP.

Try sudo kill -s HUP 1

That will cause launchd to reinitialize without restarting. This has worked for me in the past (wrt. removing zombie entries).

share|improve this answer

Sadly, it appears that killing of zombies is all about killing the parent, and if the parent is /sbin/launchd, you can kill it only with rebooting.

I'm getting zombies from using Xcode, and stopping the simulator, and it's handing the zombies to my own personal /sbin/launchd, which didn't go away when I logged out.

ps -xo pid,ppid,stat,command will show you your processes, with their parent ID in the second column.

share|improve this answer

zombie processes are already dead and cannot be killed. They should be removed from the process table automatically when the parent process dies.

They do not slow down your machine and you can leave them there (they are just entries in the process table).

There is a maximum number of processes (you can check it with sysctl kern.maxproc) and zombie processes will reduce it (as they are counted).

If you reach this limit you will not be able to create new processes and you will be forced to reboot.

share|improve this answer
"Should be removed", but they're not always. Xcode is terrible about leaving zombie processes, and they aren't cleaned up even if Xcode dies / is quit / is killed. – JRG-Developer Jan 12 '13 at 0:37
@JRG-Developer I agree but they are not a problem. They do no consume any resource. – Matteo Jan 12 '13 at 6:18
Actually they are a problem when too many are created and fork can't launch any new process and you're forced to reboot. – Adam Jan 15 '13 at 10:02
@Adam Yes, you are correct. They do not slow down your computer but they reserve resources. On my Mac (8GB of RAM) the limit is set to 2048. I updated my answer – Matteo Jan 15 '13 at 15:23
When an App gets in that state then you can't relaunch it until the old entry is cleared out. It isn't using any resources but the pollution of the table prevents a new instance from launching, therefore you're blocked until you reboot. – George May 22 '15 at 21:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .