Interview Prep/Linux/Processes, memory and OOM

`ps` shows dozens of processes in state `Z` with `<defunct>`.

BeginnerTroubleshootingProcesses, memory and OOM
Answer

Likely causes → Zombie processes: children have exited, but the parent hasn't called wait() to reap them.

Diagnose →

ps -eo pid,ppid,stat,cmd | awk '$3 ~ /Z/'
ps -o pid,cmd -p &lt;PPID>

Fix → You can't kill a zombie; it's already dead. Signal the parent (kill -CHLD &lt;PPID>) or restart the parent; once the parent exits, PID 1 adopts and reaps the zombies.

Prevent → Fix the parent's child handling; in containers use an init like tini (docker run --init).

All Linux questions Roadmap: Linux

More on Processes, memory and OOM