A paging file (or swap space) is a disk-based extension of physical memory used by an operating system’s virtual memory system to store memory pages that are not currently resident in RAM. This allows processes to use more virtual memory than the available physical memory.
When available physical memory is insufficient, the operating system removes inactive or lower-priority pages from RAM and writes them to the paging file. The pages can then be reloaded into RAM on demand when they are needed. This process is transparent to applications but incurs significantly higher access latency than RAM due to disk I/O.
Paging files are managed by the kernel and are implemented differently across operating systems (for example, as pagefile.sys on Windows or swap partitions or swap files on Unix-like systems), with policies governing page replacement, I/O scheduling, and memory prioritization.