Virtual memory is a technique that lets the operating system (OS) make a programme think it has a large, continuous block of memory, even though the computer only has a limited amount of fast RAM. The OS does this by using part of the secondary storage (hard‑disk or SSD) as an extension of RAM.
The OS manages virtual memory by dividing both the virtual address space and the physical RAM into equal‑size blocks.
The OS must decide which resident page to replace when a free frame is needed. The IGCSE only requires a simple description, for example:
| Term | Definition (IGCSE wording) |
|---|---|
| Page | Fixed‑size block of virtual memory (e.g., 4 KB). |
| Frame | Fixed‑size block of physical RAM that holds one page. |
| Page table | Structure used by the OS to map each virtual page to a RAM frame or to the swap space. |
| Swap space / paging file | Reserved area on secondary storage where pages that do not fit in RAM are stored. |
| Page fault | Occurs when a programme tries to access a page that is not currently in RAM. |
| Page‑replacement algorithm | Method the OS uses to decide which resident page to replace (e.g., LRU, FIFO). |
Assume a computer with 8 GB of RAM and a page size of 4 KB. The IGCSE uses the 1024‑based units, so:
If a programme needs 2 GB of virtual memory:
Only a portion of these pages can be resident in RAM at any one time; the rest are stored in the swap space.
| Advantage | Disadvantage |
|---|---|
| Allows execution of programmes larger than physical RAM. | Disk access is much slower than RAM, so heavy paging reduces performance. |
| Supports multitasking – each process has its own address space. | Too much paging can cause “thrashing”, making the system appear to freeze. |
| Provides process isolation, improving security and stability. | Requires dedicated disk space for swap; if the disk fills, virtual memory cannot function. |
| Simplifies programming – the OS handles memory allocation. | Extra I/O activity increases power use and can wear out SSDs. |
| Memory Type | Typical Speed | Volatility | Typical Use |
|---|---|---|---|
| RAM (primary memory) | ≈10 GB s⁻¹ (DDR4/DDR5) | Volatile – data lost when power is removed | Running programmes and active data |
| Virtual memory (RAM + swap space) | RAM speed for resident pages; disk speed (≈0.1–5 GB s⁻¹) for swapped pages | Volatile – swap area cleared on shutdown | Extends usable memory beyond physical RAM |
| Secondary storage (HDD/SSD) | ≈0.1 GB s⁻¹ (HDD) – 5 GB s⁻¹ (SSD) | Non‑volatile – retains data without power | Long‑term data storage; holds the swap space/paging file |
Virtual memory bridges the gap between limited, fast RAM and abundant, slower secondary storage. By dividing memory into pages and using a page table, the OS can give each programme the illusion of a large, private memory area. This enables larger programmes, multitasking, and process isolation, but it also introduces latency and the risk of thrashing if the system relies too heavily on swapping.
Create an account or Login to take a Quiz
Log in to suggest improvements to this note.
Your generous donation helps us continue providing free Cambridge IGCSE & A-Level resources, past papers, syllabus notes, revision questions, and high-quality online tutoring to students across Kenya.