Operating Systems

Swapping

Definition

Swapping is a memory management technique where the operating system moves a process or a portion of a process (a "page") from main memory (RAM) to a secondary storage device (like an SSD or HDD) to free up RAM.

Why It Matters

Swapping is the mechanism behind virtual memory. It allows the system to run more applications than can fit into physical RAM, but it comes at a performance cost.

Contextual Example

If your system is low on RAM, the OS might take the data from an application you haven't used in a while and "swap it out" to the disk. When you switch back to that application, there will be a delay as the data is "swapped in" from the disk back to RAM.

Common Misunderstandings

  • The dedicated space on the disk used for swapping is called a "swap file" or "swap partition".
  • Excessive swapping, known as "thrashing," can make a system unusably slow as it constantly reads and writes to the slow disk drive.

Related Terms

Last Updated: December 17, 2025