The Runtime Theory
Operating Systems

Virtual Memory in One Diagram

Virtual Memory in One Diagram

19:20#virtual-memory#page-tables#tlb#demand-paging

One diagram, one concept at a time. We build the virtual memory system from the ground up: what the hardware does, what the kernel does, and why the illusion of contiguous private memory works so well that most engineers never think about it.

Topics covered:

  • Virtual vs. physical addresses: why the translation exists
  • Page tables: the four-level hierarchy that maps virtual to physical
  • TLB: the hardware cache that makes translation fast
  • Demand paging: why malloc is a promise, not an allocation
  • Page faults: what happens when you first touch a page
  • Copy-on-write: why fork() is fast and how it avoids copying
  • Large pages: reducing TLB misses for large data structures
  • Swap: when the kernel evicts pages to disk and why it's catastrophic

Related articles

Depth, delivered weekly

One technical dispatch a week — articles and episode notes before they go public.

One technical dispatch per week. No noise.