Swap partition / swap file
Also known as: swap space, swap file, paging space, virtual memory
Swap is disk space the operating system uses as overflow for RAM. When physical memory fills, the system moves less-active data from RAM to a swap partition or swap file on disk, freeing memory for active work. It lets a device run more than its RAM alone would allow, but disk is far slower than RAM.
- Disk space used as overflow for RAM
- Part of virtual memory; far slower than RAM
- Called the page file on Windows
How swap extends memory
RAM is the fast working memory apps use while running, and it is limited. When it runs out, the system writes idle chunks of memory to a reserved area on disk — a swap partition on Linux or a swap file (the page file on Windows, swap files on macOS) — and reads them back when needed. This is part of virtual memory.
The benefit is that the device keeps working past its physical RAM limit instead of crashing. The cost is speed: disk is much slower than RAM, so heavy swapping makes a device feel sluggish.
Swap and your storage
Swap consumes disk space that grows and shrinks with demand, which is one reason a busy system can show less free space than expected. You generally do not manage it by hand — the OS sizes it automatically.
On phones, this is invisible and automatic; on desktops it ties into the page file (Windows) or compressed memory and swap files (macOS). Adding more RAM, not clearing files, is the real fix for constant swapping.