Process Count Calculator
Sum running, sleeping, stopped and zombie processes and check usage against pid_max.
Inputs
Check with: cat /proc/sys/kernel/pid_max
Total Processes
215
Usage of pid_max
0.6561%
Zombie % of Total
0.93%
Status
Healthy — comfortable headroom below pid_max.
Step by step
Values used
Running Processes (state R) = 3; Sleeping Processes (state S/D) = 210; Stopped Processes (state T) = 0; Zombie Processes (state Z) = 2; pid_max = 32,768
Total processes and usage
total = running + sleeping + stopped + zombie; usage% = total / pid_max × 100
Total Processes
= 215
Usage of pid_max
= 0.6561
Zombie % of Total
= 0.93
Status
= Healthy — comfortable headroom below pid_max.
How it works
Every process occupies a PID slot, and Linux caps the total addressable PID space via kernel.pid_max (default 32768 on 32-bit-compatible configs, up to 4194304 on 64-bit systems with the wider PID namespace enabled) — summing every process state (running R, sleeping S/D, stopped T, zombie Z) against that ceiling shows real headroom before fork() calls start failing with EAGAIN, a failure mode that surfaces suddenly and system-wide rather than gracefully per-application.
Formula
Total processes and usage
total = running + sleeping + stopped + zombie; usage% = total / pid_max × 100
- R
- running
- S
- sleeping
- T
- stopped
- Z
- zombie
- N_{max}
- pid_max
Frequently Asked Questions
How do I raise pid_max if I'm approaching the limit?
`sysctl -w kernel.pid_max=4194304` raises it immediately (up to the 64-bit-supported maximum), and adding it to /etc/sysctl.conf or a drop-in under /etc/sysctl.d/ makes it persist across reboots. Note some very old tooling assumes PIDs fit in a 16-bit range, though this is rare on modern systems.
Do zombie processes count against pid_max?
Yes — a zombie retains its PID and a minimal task_struct entry (just enough to report its exit status to the parent via wait()) until the parent reaps it, so a large buildup of unreaped zombies does consume PID space and can contribute to hitting pid_max, even though zombies use essentially no CPU or memory otherwise.
What's the difference between 'sleeping' (S) and 'uninterruptible sleep' (D) processes?
S (interruptible sleep) processes are waiting on an event (like a timer or a signal) and can be woken by signals; D (uninterruptible sleep) processes are waiting specifically on I/O completion (typically disk) and cannot be interrupted by signals, including SIGKILL — a large, persistent count of D-state processes usually indicates a storage bottleneck.