Skip to content

Zombie Process

Medium — good to knowBackend

ELI5 — The Vibe Check

A zombie process is a process that's dead but won't go away — it's finished executing but still shows up in the process table because its parent never collected its exit status. It's the walking dead of your operating system. A few zombies are harmless, but too many can exhaust your process table. The fix? Tell the parent process to wait() for its children. Or just restart everything.

Real Talk

A zombie process (defunct process) is a process that has completed execution but still has an entry in the process table because its parent hasn't called wait() to read its exit status. Zombies consume no resources except a PID table entry, but excessive zombies can exhaust PID limits. They're common in server applications that fork child processes without proper cleanup.

Show Me The Code

# Show zombie processes
ps aux | grep 'Z'

# Count zombies
ps aux | awk '{if($8=="Z") print}' | wc -l

# Find the parent of zombies
ps -o ppid= -p <zombie_pid>

When You'll Hear This

"We've got 500 zombie processes — the worker isn't reaping its children." / "Always handle SIGCHLD to prevent zombie processes."

Made with passive-aggressive love by manoga.digital. Powered by Claude.