Computer Science · Cheatsheet
Topic 5 · Resource Management (HL)
Chapter 2 · Memory management
📋 Reference · always available
Virtual memory
Each process gets its OWN linear address space; OS+MMU translate to physical RAM.
3 benefits
Isolation (security + stability) + Abstraction (programmer simplicity) + Capacity (run more than fits in RAM).
Page
Fixed-size chunk, typically 4 KB. Unit of virtual→physical mapping.
Frame
A page-sized slot in physical RAM. Page tables map pages → frames.
Page table
Per-process table mapping each virtual page number to a physical frame (or 'on disk').
MMU
Memory Management Unit — hardware on the CPU that performs page-table lookups on every memory access.
TLB
Translation Lookaside Buffer — small cache of recent page-table lookups for speed.
Page fault
Page not in RAM → interrupt → OS fetches from disk (~10 ms) → retry. 100,000× slower than RAM (~100 ns).
Thrashing
Working set > RAM → constant page faults → CPU idle + disk 100% → system unusable. Fix: free RAM.
Isolation enforcement
Hardware-enforced via MMU + page tables. Process A simply CAN'T address Process B's pages. Segfault on violation.