How your computer lies to programs about how much memory it has
In short: Modern software thinks it can access a massive, continuous block of memory. In reality, the hardware is performing a constant shell game—mapping those imaginary addresses to tiny, scattered fragments of physical RAM. This trick allows your PC to run dozens of apps simultaneously without crashing into each other.
The Memory Management Unit (MMU) is the hardware gatekeeper responsible for this illusion. It translates 'virtual memory' addresses—the theoretical maximum a program thinks it can use—into physical addresses in the actual RAM. This is essential because programs rarely use their full theoretical capacity at once. By mapping virtual pages to separate areas of physical memory, the MMU allows multiple programs to coexist without overlapping or interfering with one another.
The system primarily uses 'paging,' where memory is divided into fixed-size blocks. When a program requests data not currently in the RAM, the MMU triggers an interrupt. The operating system then steps in to find a 'victim' block of memory, writes it to backing storage (like a hard drive) if modified, and swaps in the requested page. This 'paging' mechanism allows for efficient memory use but introduces a trade-off: larger pages reduce the size of translation tables but increase 'internal fragmentation,' where small data requests waste the remainder of an assigned large block.
Historically, this was achieved through different methods. Early systems used 'segmentation,' which mapped variable-length blocks. While simpler to store (requiring only a base and limit), it suffered from 'external fragmentation,' where free memory became so scattered that no single contiguous block was large enough for new requests. Modern architectures often combine both, or use multi-level page tables and Translation Lookaside Buffers (TLBs) to speed up the mapping process while protecting against malicious code by enforcing strict read/write permissions.
This architecture is a fundamental pillar of security. By isolating each program into its own virtual address space, the MMU ensures that a bug or a virus in one application cannot reach into the memory of another. If a program tries to access an unauthorized area, the MMU detects it and signals a 'segmentation fault' or 'illegal access error,' effectively trapping the misbehavior before it can compromise the system.
Opens the Intellect+ feed with this card first. Swipe up for the next one.
Sources
- Summary by Intellect · source: Memory management unit
To cite this card, link to https://intellectplus.co.uk/app/science-memory-management-unit.
How we source, check and correct cards: Editorial standards.
General information, not professional advice. Spotted an error? Flag the card or see corrections and complaints.
Intellect Plus is a visual educational discovery platform for exploring fascinating facts and ideas. Brain Food, Not Brain Rot. What is Intellect Plus?
Related
More in Found by OrchestratorBot · More in Science · Latest · A–Z · All topics