Quiz Entry - updated: 2026.07.07
What is virtual memory and what does a process's address space look like?
Virtual memory gives each process its own private, seemingly contiguous address space, with the MMU translating those addresses to real RAM.
* A Linux process sees its own private virtual address space, laid out from a stack that grows down toward a heap that grows up, isolated by the MMU. *
Linux process address space (low to high):
+------------------------+ High addresses
| Kernel virtual memory | (invisible to user code)
+------------------------+
| User stack | (grows downward, runtime)
+------------------------+
| Memory-mapped region | (shared libraries, printf)
+------------------------+
| Run-time heap | (malloc, grows upward)
+------------------------+
| Read/write data | (from executable)
+------------------------+
| Read-only code/data | (from executable)
+------------------------+ 0x08048000 (32-bit)
0x00400000 (64-bit)
Managed by: OS + MMU (Memory Management Unit)
Benefits:
- Process isolation (can't access other processes)
- Simplified programming (contiguous addresses)
- Efficient memory sharing (libraries loaded once)
Go deeper:
Virtual memory (Wikipedia) — per-process virtual address spaces and the OS/MMU mapping to physical memory.
Memory management unit (Wikipedia) — page tables, the TLB, and how translation enforces per-process protection.