1. Data Storage
IGCSE Computer Science (0478)
  • Chapter 6: Automated & Emerging Technologies
  • Data Representation
    • Introduction
    • Why computers use binary (how binary represents data)
    • Number system
      • Introduction
      • Number Conversions
      • Addition of Binary Numbers
      • Logical binary shifts (positive 8-bit integers)
      • Two’s Complement (Signed: Positive and Negative Numbers)
      • Use of the Hexadecimal System
    • Text, Sound and Image
      • Text, Sound and Images
      • File Types
    • Data storage and File compression
      • Measurement of the Size of Computer Memories
      • Lossless and Lossy File Compression
  • Hardware
    • Computer Architecture
      • The CPU & Microprocessors
      • Von Neumann Architecture
      • Fetch-Decode-Execute Cycle (FDE)
      • Characteristics of the CPU
      • CPU Instruction Sets
      • Embedded Systems
    • Input/output devices
      • Input devices
      • Output devices
      • Sensors
    • Data Storage
      • What is Primary Storage?
      • What is Secondary Storage?
      • What is Virtual Memory?
      • What is cloud storage?
    • Network hardware
      • What is a Network Interface Card(NIC)?
      • MAC Addresses & IP Addresses
      • What is a Router?
  1. Data Storage

What is Virtual Memory?

Virtual memory is a memory management technique where the operating system
uses a section of secondary storage (hard drive or SSD) to act as an
extension of RAM when RAM is full.
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.
It is managed entirely by the Operating System (OS).
The CPU cannot tell the difference between real RAM and virtual memory.
It is not a physical component — it is a technique used by the OS.

2. Why is Virtual Memory Needed?#

RAM has a fixed, limited size.
Modern operating systems and programs demand a lot of memory.
Without virtual memory, the computer could only run as many programs
as RAM could physically hold.
Virtual memory prevents crashes and allows greater multitasking.

3. How Virtual Memory Works#

The OS divides RAM and virtual memory into fixed-size blocks called pages.

Key Terms in this Process#

TermDefinition
PageA fixed-size block of data that RAM and virtual memory are divided into
Page FileThe area on secondary storage used as virtual memory (also called swap space)
PagingThe process of moving pages between RAM and the page file
Page SwapWhen a page is moved from RAM to the page file, or vice versa
Page FaultWhen the CPU requests data that is not currently in RAM and must be fetched from the page file

4. The Paging Process — Step by Step#


5. Virtual Memory and the OS#

The Operating System is entirely responsible for managing virtual memory:
Deciding which pages to swap out of RAM.
Maintaining a page table that tracks where each page is — in RAM or in the page file.
Handling page faults by fetching the required page from secondary storage.
Deciding when to swap pages back into RAM.

6. Thrashing#

Thrashing occurs when the computer spends more time swapping pages
between RAM and the page file than actually executing program instructions.

When does thrashing happen?#

When RAM is severely insufficient for the programs running.
The OS constantly swaps pages in and out but can never keep up with demand.
The computer becomes extremely slow and almost unusable.

How to fix thrashing:#

Install more RAM — the most effective long-term solution.
Close unused programs to reduce memory demand.
Increase the size of the page file — provides more virtual memory space.

7. Advantages and Disadvantages of Virtual Memory#

✅ Advantages❌ Disadvantages
Allows more programs to run simultaneouslyMuch slower than real RAM
Prevents the system from crashing when RAM is fullCan cause thrashing if overused
Allows large programs to run on systems with limited RAMUses up secondary storage space
Managed automatically by the OS — no user effort neededRepeated page swaps increase wear on SSDs
Cost-effective — uses existing storage hardwareOverall system performance is reduced

8. Virtual Memory vs RAM#

FeatureRAMVirtual Memory
LocationPhysical chips on motherboardSection of HDD/SSD
SpeedVery fastVery slow
CostExpensive per GBCheap (uses existing storage)
Managed byHardwareOperating System
Access timeNanosecondsMilliseconds
Volatile?✅ Yes✅ Yes (page file cleared at shutdown)

9. Effect of Virtual Memory on Performance#

A small amount of virtual memory usage = slightly slower performance.
Heavy virtual memory usage = significantly degraded performance.
Constant virtual memory swapping = thrashing = system almost unusable.

10. Virtual Memory in Context — Full Memory Hierarchy#

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.

11. Key Vocabulary#

TermDefinition
Virtual MemoryA technique using secondary storage as an extension of RAM
PageA fixed-size block that memory is divided into for management
Page FileThe area on secondary storage reserved for virtual memory
PagingMoving pages of data between RAM and the page file
Page FaultWhen required data is not in RAM and must be fetched from the page file
Page SwapThe act of moving a page between RAM and the page file
ThrashingSevere slowdown caused by excessive, constant paging activity
Page TableAn OS data structure tracking the location of each page
Operating SystemThe software responsible for managing virtual memory

12. Exam Tips ✅#

Virtual memory is not a physical component — it is a technique
used by the OS using secondary storage.
Always explain why virtual memory is slower than RAM:
secondary storage (HDD/SSD) has a much longer access time than RAM.
Thrashing is the key disadvantage of virtual memory —
always define it as spending more time swapping pages than executing instructions.
A common exam question: "Why does the computer slow down when virtual
memory is being used heavily?"

→ Because secondary storage is much slower than RAM, and frequent
page swaps cause significant delays.
The solution to thrashing/slow performance from virtual memory is always
installing more RAM — state this clearly.
Do not confuse virtual memory with ROM or cache — it uses
secondary storage (HDD/SSD), not any form of primary storage chip.
Remember: the OS manages virtual memory — not the user, not the CPU directly.

Cambridge (CIE) IGCSE Computer Science — 0478 / 0984
Modified at 2026-04-03 10:00:20
Previous
What is Secondary Storage?
Next
What is cloud storage?
Built with