StudyG Logo
Study G
Concept Breakdowns

Virtual Memory Paging and Page Replacement Policies

Virtual memory allows processes to use more address space than physical RAM by mapping logical pages to physical frames. Understanding paging mechanics, the Translation Lookaside Buffer (TLB), and page replacement algorithms (FIFO, LRU, Optimal) is critical for OS coursework, GATE CS, and systems programming interviews.

Interactive Deck

5 Cards
1
Front

What is a page fault?

Click to reveal
1
Back

A page fault occurs when a process accesses a page not currently in physical memory. The OS must load it from disk, incurring high latency (milliseconds vs nanoseconds).

2
Front

TLB — Translation Lookaside Buffer

Click to reveal
2
Back

TLB is a fast hardware cache for page table entries.

  • Hit: direct physical address, very fast
  • Miss: full page table walk required
  • Hit rate ~99% in most workloads
3
Front

FIFO page replacement policy

Click to reveal
3
Back

FIFO evicts the oldest loaded page.

  • Simple to implement
  • Suffers from Belady's anomaly: more frames can cause more page faults
  • Not used in modern OS
4
Locked

LRU vs Optimal page replacement

5
Locked

What is thrashing in virtual memory?

Master this topic effortlessly.

Study G helps you master any topic effortlessly using proven learning algorithms and smart review timing

Download Study G

Frequently Asked Questions

What is Belady's anomaly and which algorithm suffers from it?

Belady's anomaly is the counterintuitive result where adding more physical frames increases page faults. Only FIFO page replacement exhibits this behavior. LRU and Optimal are stack algorithms and are immune to it.

How does the TLB improve virtual memory performance?

Without TLB, every memory access requires two lookups: one to the page table, one to data. The TLB caches recent page-to-frame translations, reducing most accesses to a single lookup. With a 99% hit rate, the average penalty is near zero.

What is the difference between paging and segmentation?

Paging divides memory into fixed-size pages — no external fragmentation, but internal fragmentation possible. Segmentation uses variable-size logical units (code, stack, heap) — supports protection but causes external fragmentation.

Modern OS use segmented paging (x86-64 uses paging predominantly).