Memory Organization & Management
Virtual memory is a crucial memory management technique that provides an "idealized abstraction" of storage resources, separating logical memory from physical memory.
Virtual memory allows programs to use more memory than physically available by utilizing specialized hardware to manage memory resources efficiently through a memory hierarchy.
Fastest, smallest
Physical RAM
Disk storage
Each program operates in its own virtual address space, preventing interference
Run programs larger than physical memory by swapping pages
Hardware-enforced memory protection between processes
Programmers work with consistent virtual addresses
Address Space: The range of virtual addresses used by the CPU and visible to programs
Memory Space: The range of physical addresses available in main memory (RAM)
Virtual address space can be larger than physical memory!
The virtual address space is divided into fixed-size blocks called pages. Physical memory is divided into equally-sized blocks called frames.
Typical Page Size
Offset Bits (4KB)
Page Number Bits (32-bit)
An associative memory cache that stores recent page-to-frame translations for fast address lookup.
When a program references a page not currently in physical memory, a page fault occurs. The operating system must load the required page from auxiliary storage.
Replace the oldest page in memory. Simple but may remove frequently-used pages.
Replace the page that hasn't been used for the longest time. Better performance but requires tracking.
Replace the page that won't be used for the longest time in the future. Theoretical best, impractical in reality.
Circular list with reference bits. Approximates LRU with less overhead.
Enter a virtual address to see the translation process
TLB Hits
TLB Misses
Page Faults
Hit Rate