← IGCSE Computer Science Paper 1

Virtual memory and computer performance

When RAM is full, the computer keeps swapping pages to slow secondary storage, so it becomes sluggish. Adding more RAM reduces swapping. Virtual memory is no replacement for RAM.

Understanding Virtual memory and computer performance in IGCSE Computer Science Paper 1

What it does: The speed gap between RAM and secondary storage is why heavy swapping makes the computer sluggish. Virtual memory is only used when RAM runs out, and it cannot match the speed of real RAM. Virtual memory lives on secondary storage (HDD or SSD), which is far slower than RAM, so every swap costs time. More RAM means more pages fit in RAM, so fewer need to be swapped out to secondary storage. Performance drops when the computer keeps swapping pages. If RAM has free space, little or no swapping is needed. Adding more RAM reduces swapping, which improves performance.

Common mistakes: Virtual memory is space on secondary storage (the drive), not inside RAM. This is why swapping pages is slower than using RAM. Heavy swapping makes the computer feel sluggish, not quick. The computer keeps waiting for slow secondary storage.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 314–324) and word search (Modules 304–324).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
Why does a computer slow down when it swaps pages between RAM and virtual memory a lot?
Secondary storage is much faster than RAMSecondary storage is much slower than RAM
Matches
Virtual memory is faster than RAM, so a computer with lots of virtual memory never needs more RAM
↓
Virtual memory uses secondary storage, which is much slower than RAM, so it cannot replace RAM.
Applying
Meanings
Term
thrashing
Meaning
When RAM is full, the computer keeps swapping pages to slow secondary storage, so it becomes sluggish. Adding more RAM reduces swapping. Virtual memory is no replacement for RAM.
Practice
IF RAM_full = TRUE THEN
Testing
Gaps
IF ramFull
Check Answer
Spots
2Pages move to virtual memory
3Virtual memory is inside RAM

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Viperfish' badge — Deep Debugger, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. Why does a computer slow down when it swaps pages between RAM and virtual memory a lot?
A. Secondary storage is much slower than RAM ✓
B. Secondary storage is much faster than RAM
Virtual memory lives on secondary storage (HDD or SSD), which is far slower than RAM, so every swap costs time.
2. A computer has very little free RAM and many programs open. What is likely to happen?
A. The computer speeds up as it uses more virtual memory
B. Heavy swapping makes the computer sluggish ✓
With RAM full, pages are constantly moved to and from secondary storage, so the computer becomes slow and unresponsive.
3. Which change would reduce the amount of swapping on a computer?
A. Adding more RAM ✓
B. Adding more virtual memory
More RAM means more pages fit in RAM, so fewer need to be swapped out to secondary storage.
4. True or false: virtual memory is a full replacement for RAM.
A. False - it only extends RAM and is slower ✓
B. True - it works just as fast as RAM
Virtual memory helps when RAM is full, but it is much slower, so it cannot replace having enough RAM.
5. Which statement best describes when virtual memory hurts performance?
A. When RAM has plenty of free space
B. When pages are swapped in and out all the time ✓
Performance drops when the computer keeps swapping pages. If RAM has free space, little or no swapping is needed.

Match the Pairs

thrashing → The computer spends most of its time swapping pages between RAM and secondary storage, so it becomes very slow
Upgrade RAM from 4 GB to 16 GB → Gives the computer more space for running programs, so fewer pages are swapped to virtual memory and it runs faster
Secondary storage is much slower than RAM, so using it as virtual memory slows the computer down → RAM speed >> HDD speed, so swapping = slow
Virtual memory is only a backup when RAM is full and is not a replacement for RAM → IF RAM_full THEN use virtual_memory
Virtual memory is faster than RAM, so a computer with lots of virtual memory never needs more RAM → Virtual memory uses secondary storage, which is much slower than RAM, so it cannot replace RAM.
Heavy swapping makes the computer faster because pages move to secondary storage more often → Heavy swapping makes the computer slower, because the CPU must wait for slow secondary storage to move pages.

Key Term

thrashing
When RAM is full, the computer keeps swapping pages to slow secondary storage, so it becomes sluggish. Adding more RAM reduces swapping. Virtual memory is no replacement for RAM.

Fill in the Blanks

1. IF ramFull THEN swapPages() ENDIF
Hint: Type the keyword that follows the condition and starts the block of code to run.
2. IF swapsPerSecond > 100 THEN sluggish = TRUE ENDIF
Hint: Type the comparison operator meaning 'greater than', showing that heavy swapping makes the computer sluggish.
3. ramSize = ramSize + 8 swapping = swapping - 1
Hint: Type the arithmetic operator that adds more RAM, which reduces the amount of swapping.
4. IF virtualSpeed < ramSpeed THEN OUTPUT "Not a RAM replacement" ENDIF
Hint: Type the comparison operator showing virtual memory is slower than RAM.
5. state = thrashing OUTPUT "Computer is sluggish"
Hint: Type the term for constant page swapping between RAM and secondary storage that makes the computer sluggish.

Spot the Error

Question 1
A RAM is full
B Pages move to virtual memory
C Virtual memory is inside RAM
D so it is slower than RAM
Line C — Virtual memory is space on secondary storage (the drive), not inside RAM. This is why swapping pages is slower than using RAM.
Question 2
A WHILE swapping is heavy
B computer feels very quick
C storage is slower than RAM
D ENDWHILE
Line B — Heavy swapping makes the computer feel sluggish, not quick. The computer keeps waiting for slow secondary storage.
Question 3
A pagesSwapped ← 500
B IF pagesSwapped > 100 THEN
C OUTPUT 'Computer is fast'
D ENDIF
Line C — A high number of swapped pages means thrashing, so the computer is slow. The output should say 'Computer is slow'.
Question 4
A Computer has 1 GB of RAM
B Program needs 3 GB
C VM gives extra space
D VM is as fast as RAM
Line D — Virtual memory is on secondary storage, which is much slower than RAM. It should say VM is slower than RAM.
Question 5
A Many programs are open
B RAM stays almost empty
C Pages are swapped constantly
D Thrashing slows the computer
Line B — Thrashing happens when RAM is full. If RAM stayed almost empty there would be no need to swap pages. It should say RAM fills up quickly.

Student with a class code? Join your class →