HeadlinesBriefing favicon HeadlinesBriefing.com

Why swap space was once twice RAM size

Hacker News •
×

The long-standing recommendation that swap space should be twice the size of physical memory has its roots in early computing constraints. This rule emerged during the 1980s and 1990s when RAM was expensive and systems often ran with minimal memory.

Early operating systems like Unix and Linux needed swap space to handle memory overflow, and the 2x guideline provided a safety buffer. With typical systems having 4-16MB of RAM, allocating 8-32MB of swap seemed reasonable for handling memory-intensive tasks and preventing crashes. The rule became conventional wisdom passed down through documentation and system administration guides.

Modern systems with gigabytes or terabytes of RAM have made this rule largely obsolete. Current best practices suggest swap size should be based on system needs rather than a fixed ratio. For most modern workloads, 4-8GB of swap is sufficient, regardless of total RAM. The persistence of this outdated guideline in some documentation and tutorials continues to confuse system administrators managing contemporary hardware.