Glossary

Zombie Process

A zombie (state Z in ps) is a process that has terminated but whose entry still exists in the kernel's process table because its parent has not yet collected its exit status. Zombies hold no memory or file descriptors—only a small kernel structure recording their PID, termination status, and resource usage—waiting for the parent to call wait() or waitpid().

In normal operation, zombies are transient: a well-behaved parent calls wait promptly and the zombie disappears. Problems arise when the parent is buggy or slow, leaving a pileup of zombies. If enough accumulate, they can exhaust the PID space, at which point fork starts failing.

You cannot kill a zombie—it is already dead. The remedy is to make its parent reap it, or to kill the parent, causing the zombies to be re-parented to init (PID 1), which reaps them automatically. Containers that run an unreaping process directly as PID 1 (a common mistake with docker run python app.py) can accumulate zombies over time; running under tini or similar lightweight init resolves the issue.

Related terms: Orphan Process, Process, init, fork

Discussed in:

Also defined in: Textbook of Linux