This repository provides a concise guide and Bash snippets for detecting, handling, and preventing zombie (Z/defunct) and ghost/hung (D-state) processes on Linux systems. Zombies occur when child processes finish but parents fail to reap their exit status, consuming PID slots without resources. Ghosts (hung I/O) are stuck in uninterruptible sleep, often due to disk/NFS issues. These notes are based on common sysadmin practices (tested on Ubuntu/Debian). Use as a quick reference or integrate into scripts/services. Version: 0.0.1 (Dec 04, 2020) Author: Parameswar Sahu
Why This Matters
Zombies waste PID space (max ~65k on 64-bit systems). Ghosts degrade performance (e.g., NFS hangs block I/O). Early detection prevents escalation to OOM kills or reboots.