= Virtual memory
{wiki}
<Virtual memory> gives an <operating-system process> an <address space> whose <virtual addresses> are translated to <physical addresses> under <operating system> control. In a system using <paging>, each resident <memory page> maps to a <page frame>; <page tables> describe the mappings and access permissions, while the <memory management unit> enforces them. The same <virtual address> in two <operating-system processes> can refer to different <page frames>. A deliberate shared mapping can instead make different <virtual addresses> refer to the same <page frame>. https://pages.cs.wisc.edu/~remzi/OSTEP/vm-intro.pdf[Arpaci-Dusseau and Arpaci-Dusseau, OSTEP chapter 13: Address Spaces]{ref}
For example, with 256-<byte> <memory pages>, let process A map virtual page `0x12` to <page frame> `0x07`, and process B map virtual page `0x12` to <page frame> `0x09`. Their identical <virtual address> `0x1234` then denotes <physical address> `0x0734` in A and `0x0934` in B. The address acquires meaning from the current <address space>, not just its numerical value. See <paging> for the calculation.
This separation makes programs easier to place in <computer memory>: consecutive <virtual addresses> need not occupy consecutive <page frames>. It also provides isolation and controlled sharing. <Virtual memory> does not require secondary storage: a system can translate and protect <virtual addresses> while keeping every allocated <memory page> resident in <computer memory>. <Demand paging> adds allocation or loading on first use, and can support an <address space> larger than available <computer memory>; the amount that can be used at once is still limited. Keeping a <working set> resident avoids <memory thrashing>.
An early concrete implementation was Manchester's Atlas. Kilburn, Edwards, Lanigan and Sumner's April 1962 paper describes automatically combining fast core storage with drum storage, transferring 512-word blocks and translating their addresses through page address registers. Its attraction was to spare programmers explicit transfers between these storage levels. This historical use of secondary storage is one application of <virtual memory>, rather than a requirement of every <virtual memory> system. The accessible text below is a reprint of the paper. https://www.dcs.gla.ac.uk/~wpc/grcs/kilburn.pdf[Kilburn et al., One-Level Storage System, 1962, sections 1 and 3]{ref}
Back to article page