Virtual Memory = A portion of secondary storage used by the OS to
simulate extra RAM, allowing more programs to run than physical RAM alone
would permit.
| Term | Definition |
|---|---|
| Page | A fixed-size block of data that RAM and virtual memory are divided into |
| Page File | The area on secondary storage used as virtual memory (also called swap space) |
| Paging | The process of moving pages between RAM and the page file |
| Page Swap | When a page is moved from RAM to the page file, or vice versa |
| Page Fault | When the CPU requests data that is not currently in RAM and must be fetched from the page file |
| ✅ Advantages | ❌ Disadvantages |
|---|---|
| Allows more programs to run simultaneously | Much slower than real RAM |
| Prevents the system from crashing when RAM is full | Can cause thrashing if overused |
| Allows large programs to run on systems with limited RAM | Uses up secondary storage space |
| Managed automatically by the OS — no user effort needed | Repeated page swaps increase wear on SSDs |
| Cost-effective — uses existing storage hardware | Overall system performance is reduced |
| Feature | RAM | Virtual Memory |
|---|---|---|
| Location | Physical chips on motherboard | Section of HDD/SSD |
| Speed | Very fast | Very slow |
| Cost | Expensive per GB | Cheap (uses existing storage) |
| Managed by | Hardware | Operating System |
| Access time | Nanoseconds | Milliseconds |
| Volatile? | ✅ Yes | ✅ Yes (page file cleared at shutdown) |
The further down the hierarchy, the slower, larger, and cheaper the storage.
Virtual memory sits between RAM and full secondary storage in practice,
because it is secondary storage used as extra RAM.
| Term | Definition |
|---|---|
| Virtual Memory | A technique using secondary storage as an extension of RAM |
| Page | A fixed-size block that memory is divided into for management |
| Page File | The area on secondary storage reserved for virtual memory |
| Paging | Moving pages of data between RAM and the page file |
| Page Fault | When required data is not in RAM and must be fetched from the page file |
| Page Swap | The act of moving a page between RAM and the page file |
| Thrashing | Severe slowdown caused by excessive, constant paging activity |
| Page Table | An OS data structure tracking the location of each page |
| Operating System | The software responsible for managing virtual memory |