Paging vs Swapping in OS: Key Differences Explained
Paging moves fixed-size pages between RAM and disk to free memory, while Swapping moves an entire process out of RAM, suspending it until recalled.
Your laptop “freezes” for a second when you open the 50th Chrome tab—most call it “swapping,” but it’s usually paging. The mix-up happens because both involve disk thrashing and the same LED blinking, making them feel identical to users.
Key Differences
Paging swaps 4 kB blocks; Swapping swaps the whole process address space. Paging keeps the process runnable; Swapping stops it cold. One is granular, the other nuclear.
Which One Should You Choose?
On desktops with SSDs, rely on paging—kernels already favor it. Enable swap only for RAM-starved servers or crash-proof hibernation on laptops. Modern OSes auto-decide; manual tuning is rarely worth the risk.
Can both run at once?
Yes. Linux may page out anonymous memory while swapping a whole frozen tab, combining both methods for maximum pressure relief.
Does SSD make swapping painless?
It lowers the pain but doesn’t cure it; random 4 kB writes still lag behind DRAM access by magnitudes.