You get paged: a build host has 3,000 processes in state Z, all [worker] <defunct>. A teammate has already run kill -9 on them and nothing changed. Why, and what actually fixes it?
- kill -9 needs root for defunct processes; retry with sudo. Permissions are irrelevant; there is no running process to receive the signal.
- They are consuming memory and will trigger the OOM killer; drop caches. Zombies have released their memory; the only cost is PIDs, which is why thousands of them matter.
- They are stuck in uninterruptible I/O; wait for the disk or reboot. That describes D state. Zombies hold no resources but a PID entry.
- Zombies are already dead; they are PID table entries waiting for their parent to call wait(). Fix or restart the parent (or, if the parent is gone, PID 1 must reap them). A signal cannot kill something that has already exited. The parent's failure to reap is the bug.
You cannot kill a zombie because it is already dead, so fix or restart its parent, which must call wait().
A zombie is a finished process whose exit status has not been collected. The parent is at fault, and the practical risk is PID exhaustion, not memory. The interview signal is diagnosing the parent (ps -o ppid=) rather than attacking the children.
Attacking the zombies: more kill -9, or 'reboot to clear them'. The parent is the bug, and a reboot destroys the evidence of which parent it was.