AlgoPlus//structures / vm-tlb
Read the theory

Virtual Memory & TLB

Translate a virtual address: check the TLB first, then the page table, then disk.

VPN
Result
Phys addr
Legend
TLB hit
TLB miss
Page fault
AI Tutor Workspace
In a nutshell
Each program runs in its own pretend (virtual) address space, so the CPU must translate every virtual address into a real physical one. The address splits into a page number, which gets translated, and an offset, which stays the same. A small, fast cache called the TLB is checked first; if the translation is there (a hit) it is instant. On a miss the system walks the page table in memory, and if the page is not in memory at all, a page fault loads it from disk.
Ready
Press play to begin the cinematic walkthrough.
A virtual address splits into a page number and offset; only the page number is translated. The TLB caches recent translations for instant hits; a miss walks the page table, and a non-resident page triggers a page fault that loads it from disk.
Key terms
Go deeper in the lesson
Read the full theory, intuition & complexity for Virtual Memory & TLB.