Right now, dozens of processes are running on your computer simultaneously â your browser, your editor, background services. Each one is convinced it has exclusive access to the same enormous block of addresses starting at 0. That cannot all be literally true. And yet it works perfectly.
The trick is virtual memory. Instead of handing each process a slice of real RAM, the operating system gives it a private virtual address space â a fiction the hardware enforces transparently. Every memory address a program uses is a virtual address. Before any byte can actually be read or written, the CPU must silently translate it into a physical address â the real location in RAM chips.
The data structure that records how virtual pages map to physical frames is called a page table. Every process has its own, and it is the cornerstone of memory isolation: even if two processes use the same virtual address, the OS maps them to different physical locations, so neither can ever see the other's data.
Translating every address through a page table would be cripplingly slow, so modern CPUs add a small, fast cache called the Translation Lookaside Buffer (TLB). A TLB hit avoids the table walk entirely; a TLB miss triggers the full lookup and updates the cache. Because programs access memory in clusters â locality of reference â TLB hit rates above 99 % are routine, keeping the overhead nearly invisible.
Comments
Loading comments...