Virtual memory
Virtual memory is the abstraction by which an operating system presents each process with the illusion of a contiguous, private address space that may be larger than the physical RAM installed in the machine. The illusion is maintained through a mapping — managed by the kernel and enforced by hardware — between virtual addresses and physical frames, with pages that are not currently needed stored on disk and fetched on demand. This mechanism is the foundation of process isolation: without virtual memory, every program would see every other program's data, and memory management would be a matter of convention rather than enforcement.
The design of a virtual memory system encodes a theory of locality. Programs do not access memory uniformly; they cluster their references in small regions that change slowly over time. The virtual memory manager exploits this clustering through page replacement algorithms that attempt to keep frequently accessed pages in RAM while evicting pages that are unlikely to be needed soon. When a program accesses a page that is not in RAM, a page fault occurs, and the operating system must pause the program, fetch the page from disk, and resume execution — a sequence that can take thousands of times longer than a normal memory access.
See also: Operating system, Kernel, Memory management, Page fault, Paging