Swap
Swap is disk space that an operating system uses as overflow for memory, moving rarely used pages out of RAM when it runs low.
Swap is an area on disk that the kernel uses to extend physical memory. When memory fills up, the kernel moves pages that have not been used recently to swap. If a program touches one of those pages again, the kernel reads it back from disk. Programs keep running without knowing that part of their memory is on disk.
Swap lets a system survive short bursts of memory use instead of killing a process. The price is speed, since a disk is far slower than memory, even a fast one. A system that keeps moving pages in and out spends most of its time waiting, which is called thrashing. Many servers therefore use little or no swap and prefer to stop a process that uses too much memory.
Inside a sandbox, swap is usually small or turned off, and each sandbox has a fixed memory limit. A sandbox that goes over its limit has a process killed, rather than slowing its neighbors down. The host may use swap or compression to overcommit memory across many sandboxes. Heavy swapping on a host slows every sandbox on it, so platforms watch memory pressure closely.
Related terms