Virtual Memory in One Diagram
Virtual Memory in One Diagram
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
mallocis 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
How Virtual Memory Works
Page tables, TLB, and demand paging — why your 16GB laptop 'has' 128GB of addressable memory.
What Really Happens During a System Call
Trap, ring transition, and the syscall table — the cost of asking the kernel for help and why it's never free.
How an Operating System Schedules a Thread
Between your code and the CPU sits a scheduler making decisions every millisecond: priorities, context switches, and the physics of 'the thread was runnable but the OS said no'.
Depth, delivered weekly
One technical dispatch a week — articles and episode notes before they go public.
One technical dispatch per week. No noise.