Memory Management: Virtual Illusions & Hard Realities.
Visualization: 1. Virtual Memory & The MMU
CPU
Requests Data
Virtual Memory
Fake Address Space
MMU (Page Table)
Hardware Map
Physical RAM
Actual Hardware
Swap Disk
Slow Fallback
Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.
DOWNLOADING CONCEPT: 1. VIRTUAL MEMORY & THE MMU...
↳Processes do not see actual physical RAM hardware.
↳Instead, the Linux kernel gives every process a beautiful lie: a massive, contiguous Virtual Memory space.
↳When a process tries to read/write memory, the MMU (Memory Management Unit, a hardware chip on the CPU) intercepts the virtual address and uses the OS's Page Table to translate it into a physical RAM address.
↳If the required data is in RAM, it's a Page Hit (fast!).
↳If the data isn't in RAM (perhaps it was swapped to disk), the MMU triggers a Page Fault (exception).
↳The kernel pauses the process, fetches the data from disk into RAM, updates the Page Table, and resumes the process.
↳This is extremely slow.
▲ LIVE INCIDENTAn engineer reports: 'The database server is out of memory! It has 128GB of RAM, and the database is only using 40GB, but free shows 0!'