Fork Bomb Simulator
Visualize how the :(){ :|:& };: fork bomb works. Watch exponential process growth, understand resource exhaustion, and learn prevention with ulimit and cgroups.
Category: Security
What You Will Learn
- Understand how fork bombs create exponential process growth
- See how resource exhaustion leads to system crashes
- Learn to prevent fork bombs with ulimit, cgroups, and systemd
Topics covered: linux, bash, security, processes
Fork Bomb Simulator
Visualize how the infamous fork bomb works and why it crashes systems in seconds
Hover over each part to see what it does. The function calls itself twice, piping to a background copy - exponential growth.
Press Start to unleash the fork bomb
Exponential Growth
Each process spawns 2 more. After 10 iterations: 1,024 processes. After 20: over 1 million. Most systems hit their PID limit well before that.
Resource Exhaustion
Every process consumes CPU time, memory, and a process table entry. The kernel scheduler gets overwhelmed trying to context-switch between thousands of processes.
Prevention
Set process limits with ulimit -u, use cgroups, or configure TasksMax in systemd unit files. Most modern distros set sane defaults.