Every process behaves as though it owns the entire address space of the machine, starting from address zero, with no other program in sight — that's a carefully maintained illusion, and understanding it explains a surprising amount of how memory bugs and memory limits actually work.
2 min read
Ask any process what memory addresses it can use, and the honest answer is "nearly the entire address space" — often the same huge range regardless of how much physical RAM the machine actually has, or how many other processes are running. This is virtual memory: each process gets its own private, virtual address space, and the operating system (with hardware help) is responsible for the illusion, translating every virtual address a program uses into wherever the corresponding data actually lives in physical RAM — or, sometimes, on disk.
Address translation happens in hardware, on every single memory access, via the MMU — a component built into the CPU specifically for this. Doing this translation in hardware rather than software is what keeps it fast enough to happen on literally every memory reference a running program makes, which would be catastrophically slow if it required a software lookup each time.
Rather than translating individual bytes, virtual memory is divided into fixed-size chunks called pages (commonly 4KB), each independently mapped to a physical location — or marked as not currently present in RAM at all. Lesson 7 covers this mapping mechanism (paging) and what happens when a page a process needs isn't currently in RAM.
On a modern system, physical RAM running low doesn't necessarily mean a process crashes immediately — the OS can move rarely-used pages out to disk (swap space) to free up RAM for more active data, then bring them back on demand. This is much slower than RAM (disk access is orders of magnitude slower), which is exactly why a machine that's started swapping heavily feels dramatically slower even though it hasn't technically run out of memory yet — it's paying a steep, repeated cost to keep shuffling data between RAM and disk.
Check your understanding
A quick comprehension check — not tracked, not graded, just for you.
1. Why does virtual memory give each process its own private address space instead of using physical addresses directly?
2. Why is address translation performed by the MMU in hardware rather than in software?
3. Why doesn't running low on physical RAM necessarily mean a process crashes immediately?
Operating Systems Fundamentals