Fork Bomb
Updated 2026-07-30
Summary
A fork bomb (also called rabbit virus or hydra virus) is a denial-of-service (DoS) attack against a computer where a process continually replicates itself to deplete available system resources, slowing down or crashing the system due to resource starvation.
Definition
An extremely short piece of code that replicates itself infinitely. Process A creates processes B and C, and B and C each create two new processes, leading to exponential growth that instantly exhausts system resources and causes a crash. Scaffold use: understanding the destructive power of exponential self-replication. In biological invasions, cancer metastasis, or the spread of malicious rumors, the mechanism is a fork bomb. The only way to counter it is not to kill processes one by one (they are too many), but to limit the reproduction rate or set a maximum process count quota.
Introduction
How to use
Understanding the destructive power of exponential self-replication. In biological invasions, cancer metastasis, or the spread of malicious rumors, the mechanism is a fork bomb. The only way to counter it is not to kill processes one by one (they are too many), but to limit the reproduction rate or set a maximum process count quota.
Mechanism
In Unix-like systems, fork() duplicates a process. A fork bomb makes each new process recursively fork two more processes, causing the number of processes to grow exponentially (2^n), exhausting PIDs and memory in a very short time, making the system unable to create new processes and thus freezing. The mechanism is 'unbounded exponential self-replication'.
Practice
In progress 0/4Practice this model in one real situation:
Cases
- Classic one-line bash fork bomb: `:(){ :|:& };:` quickly crashes the system; analogous to biological invasions and exponential rumor spread.
Common pitfalls
- Trying to kill child processes one by one—since reproduction is far faster than elimination, you can never kill them all; the real defense is rate limiting, not cleanup.
Sources
Source support: Explicit
References currently contain only Wikipedia links; primary sources still need review.
- en.wikipedia.orghttps://en.wikipedia.org/wiki/Fork_bombverified
account_treeGenealogyexpand_more
PRIVATE NOTES · Only visible to you
SAVED Q&A
ENTRY Q&A · Private saving available
Ask with a clear boundary
thinkingmodels answers from published entry context only.
Your question is sent to thinkingmodels. The answer uses public entry context only.
RELATED MODELS