MacOS – In Mavericks’ Activity Monitor, what is a “Zombie?”

activity-monitormacos

I have Nginx installed; compiled via MacPorts, and configured to launch on start-up. When I go to the Disk tab of Activity Monitor after installing Mavericks, the nginx process(es) is listed with a kind of "Zombie," or sometimes "64 bit, Zombie." What does this mean?

Zombies on my Mac!

Best Answer

According to wikipedia, a zombie process is a process that has completed executing, but still has an entry in the process table. In other words, a zombie process has finished executing, but it hasn't been cleaned up yet.

When a process finishes, its return code needs to be returned to the parent process. Normally, this happens immediately, so you don't see the zombie process. However, sometimes, the parent process doesn't cooperate, and the zombie stays in the process table indefinitely.

If you want to get rid of a zombie process, you have three options:

  1. Wait. Hopefully it'll clear up on its own.
  2. Send a SIGCHLD to the zombie's parent. If it's behaving correctly, it'll fetch the return code of the zombie process, and the system can then reap the zombie process.
  3. Kill the parent process. When you kill a process, its children are adopted by init, which will clean everything up for you.