← Back to Universe Map

🧮 Memory Planet

Virtual Memory, Paging, Page Tables, and Memory Management

🌟 What is This Planet?

The Memory planet explores how processes use virtual memory, how the OS maps virtual pages to physical frames, and how the page table works.

You'll understand:

  • Virtual vs Physical memory
  • Pages and frames
  • Page tables and translation
  • Page faults
  • Memory protection
  • Demand paging

📚 Core Concepts

Virtual Memory: Each process sees its own address space

Page: Fixed-size block of virtual memory (e.g., 4KB)

Frame: Fixed-size block of physical RAM

Page Table: Maps virtual pages → physical frames

Page Fault: CPU tries to access unmapped page → trap to kernel

Demand Paging: Load pages only when accessed

🧠 The Mental Model

Think of virtual memory like apartment buildings:

  • Each process has its own "building" (virtual address space)
  • Apartments = pages
  • Physical RAM = actual land
  • Page table = directory mapping apartments to land parcels
  • Unused virtual apartments don't use real land

⚡ Key Flows

Memory Access (hit):

  1. CPU generates virtual address
  2. MMU looks up page table
  3. Finds physical frame number
  4. Accesses physical RAM

Page Fault Flow:

  1. CPU tries to access unmapped page
  2. Page fault trap to kernel
  3. Kernel finds free frame (or evicts one)
  4. Loads page from disk into frame
  5. Updates page table
  6. Process continues from same PC

🚧 Interactive Memory Simulator Coming Soon

We're building an interactive memory visualization that will let you: