Virtual memory keeps only needed pages in RAM. On a page fault the OS loads the page, replacing another if memory is full.
1Page replacement
FIFO: replace the oldest page (suffers Belady's anomaly)
LRU: replace the least recently used page
Optimal: replace the page used furthest in the future (minimum faults)