LOGBOOK

HELP

Quiz Entry - updated: 2026.07.05

What is a zombie process and how is it created?

A zombie is a process that has already exited but whose exit status the parent hasn't collected yet — so the kernel keeps an empty entry for it.

Two lifecycles — ZOMBIE (child exits, parent never wait()s, lingers) vs ORPHAN (parent dies, child runs on, PID 1 adopts and reaps it).

* Zombie = exited-but-unreaped (parent forgot to wait()); orphan = still-running with a dead parent, adopted by PID 1. *

When a process exits, it doesn't vanish instantly. The kernel needs to hand the exit code back to the parent (did the child succeed or fail?). So it keeps a tiny placeholder — just the PID and exit status — until the parent calls wait() to read it. That placeholder is the zombie.

Lifecycle:

  1. Child calls exit() — its memory and resources are released
  2. Kernel retains a minimal entry (PID + exit status)
  3. Parent is supposed to call wait() to "reap" it, which frees the entry
  4. If the parent never reaps it, the zombie lingers

Why it's harmless yet annoying:

  • It uses no CPU or memory — it's already dead
  • It only occupies a slot in the process table (which is finite)
  • It shows state Z in ps
  • You can't kill it — there's nothing to kill; kill -9 does nothing to a corpse

So how do you clear zombies? You go after the parent. Either fix the buggy parent to call wait(), or kill the parent. When the parent dies, its zombie children are re-parented to PID 1, which reaps them automatically.

Orphans vs zombies (easy to confuse): an orphan is a process that's still running but whose parent has died; PID 1 adopts it and will reap it when it eventually exits. A zombie has already exited and is waiting to be reaped.

Tip: A pile of zombies almost always means one buggy parent program that forgot to wait().

Go deeper:

From Quiz: LIOS / Logs, Processes and Services | Updated: Jul 05, 2026