Skip to main content

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

Supported byDigitalOceanDevDojoAcronisPluralsightBecome a sponsor

Fork Bomb Simulator

Visualize how the infamous fork bomb works and why it crashes systems in seconds

How the Fork Bomb Works
:(){ :|:& };:

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

Process Log
$ waiting...
Controls
System Resources
Processes0.0 / 512
CPU0.0% / 100%
Memory0.0MB / 256MB
Protection
Why Fork Bombs Are Dangerous

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.

Sponsored
Carbon Ads