`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 <PPID>
Fix → You can't kill a zombie; it's already dead. Signal the parent (kill -CHLD <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).
More on Processes, memory and OOM
A Java service disappears without an error in its own log. `dmesg` shows `Out of memory: Killed process 4121 (java) total-vm:... anon-rss:...`.BeginnerA service gets killed with `Memory cgroup out of memory: Killed process ...` but the host has 20 GB free.IntermediateZombie count keeps climbing into the thousands and new processes fail with `fork: Resource temporarily unavailable`.AdvancedAn app crashes under load with `java.io.IOException: Too many open files` (or `EMFILE`).BeginnerYou raised `nofile` in `/etc/security/limits.conf` to 65536, but the service still shows `Max open files 1024`.IntermediateThe whole host can't open files: `VFS: file-max limit 98304 reached` in `dmesg`.Advanced