GCSE · Computer Science · OCR · Spec J277

Virtual memory

Twenty tabs, music, a game loading: RAM runs out of room. Your computer doesn't quit. It borrows space from somewhere slower. That's virtual memory, and it's why things crawl.

Computer Science · Memory

Watch RAM run out of room

A toy model: this RAM has just three slots (real RAM holds far more). Step through and follow where each program's data goes.

Predict as you go: when RAM is full, which data should leave, and where does it go?

Phase: 1 · Room to spare

RAM slot 1

Browser

RAM slot 2

Essay

RAM slot 3

—

Virtual memory

—

Output

 

Step 1: Your browser and your essay are open. RAM is the computer's main memory: it holds the data and instructions the CPU is using right now, and the CPU can get at it quickly.

1 / 7

Press Next for each step. The strip labelled Output logs every move to or from secondary storage.

Step 1 of 7: Your browser and your essay are open. RAM is the computer's main memory: it holds the data and instructions the CPU is using right now, and the CPU can get at it quickly..

Why it gets slow

?

Reason it through

Why does a computer slow down once its RAM is full?

Link 1 of 4

First link · your turn

RAM can't fit everything that's open. What happens to the data that isn't actively being used?

2
Locked — reveal the link above first
3
Locked — reveal the link above first
4
Locked — reveal the link above first

What is it, really?

Is Jay right?

Your friend Jay says: "Virtual memory? That's just extra RAM the computer keeps spare for when it's busy."

Which is closest to what YOU think virtual memory is?
How sure are you?

Check the answer

Where does this answer go wrong?

Sam's RAM is full. A music app Sam hasn't used for a while has been moved to virtual memory. Sam now clicks back into it. Describe what happens.

A student's answer — which line goes wrong?

WHAT YOU'VE LEARNED

A quick recap of today's lesson.

What your computer does when RAM runs out of room, and why everything starts to crawl.

What you need to know

  • RAM (random access memory) is the computer's main memory: it holds the data and instructions the CPU is using while the computer runs.
  • The CPU can access RAM faster than it can access files stored in secondary storage.
  • Have a goYour classmate Max is very sure: "The CPU should just grab everything straight from secondary storage. RAM is a waste of money." What is Max forgetting?

    RAM is faster for the CPU to access than secondary storage.

    Max is right that files are stored in secondary storage, but the data the CPU is using right now sits in RAM, which the CPU can reach faster.

  • RAM is temporary and volatile: switch the power off and everything in it is lost.
  • RAM has a set capacity, so it can fill up when lots of programs and data are open.
  • Have a goRAM is completely full and you open one more program. Does RAM just stretch to fit it: yes or no?

    No. RAM has a set capacity.

    The tempting 'it'll make room somehow' ignores the fixed limit: a full RAM has no spare space, so something else has to happen.

  • Virtual memory is a memory management technique: storage borrowed from secondary storage, used when RAM is full.
  • When there isn't enough RAM for every active program, data and instructions not actively being used are moved into virtual memory.
  • Data moved into virtual memory is stored as a page.
  • When the CPU needs that page, it moves back into RAM, and other data is moved out to make room.
  • Have a goRAM is full and the CPU needs a page from virtual memory. How many moves to or from secondary storage does that involve, at least?

    At least two: the page comes back into RAM, and other data goes out to virtual memory.

    Answering 'one' forgets that RAM is full: the page can't come back until other data leaves for virtual memory.

  • Secondary storage is slower for the CPU to access than RAM, so relying on virtual memory slows the computer down.

The big picture

Virtual memory is storage borrowed from secondary storage and used when RAM is full. Data that isn't actively being used is moved out of RAM and stored there as a page; when the CPU needs it, it is moved back into RAM and other data moves out. Secondary storage is slower for the CPU to access than RAM, so the computer slows down.

Key points

1RAM (random access memory): volatile main memory holding the data and instructions in current use, faster for the CPU than secondary storage.
2RAM has a set capacity limit.
3Virtual memory: a memory management technique that borrows secondary storage when RAM is full.
4Idle data is moved out of RAM and kept in virtual memory as a page.
5A page the CPU needs goes back into RAM; other data moves out to make space.
6Relying on virtual memory slows the computer, because secondary storage is slower to access than RAM.

Worked example

Problem

A computer has several programs open and its RAM is full. The user opens one more program. Describe how virtual memory lets the new program be loaded, and give one effect on the computer's performance.

⚠ Watch out

Calling virtual memory 'extra RAM', or saying it makes the computer faster. It's neither: it is space borrowed from secondary storage, and because secondary storage is slower for the CPU to access than RAM, relying on it slows the computer down.

🧠

Memory hook

RAM is your desk: limited space, but right in front of you. Virtual memory is a box in the cupboard down the corridor. Anything you're not using goes in the box; fetching it back means a walk, so everything slows. (Unlike your desk, RAM empties when the power goes.)

✓

Check yourself

Cover the page and answer in your own words: what is virtual memory, where is it, and what is data stored as when it is moved there?

Flashcards

(10)
What does RAM hold while the computer is running?
The data and instructions the CPU is currently using.
RAM is volatile. What does that mean?
Its contents are lost when the power is switched off.
Which can the CPU access faster: RAM or secondary storage?
RAM.
Why can RAM fill up?
It has a set capacity limit.
What is virtual memory?
A memory management technique: storage borrowed from secondary storage and used when RAM is full.
When does a computer use virtual memory?
When there isn't enough RAM to store all the active programs and data.
Which data is moved from RAM into virtual memory?
Data and instructions that are not actively being used.
What is data stored as when it is moved into virtual memory?
A page.
What happens when the CPU needs a page that is in virtual memory?
The page is moved back into RAM, and other data is moved out to make room.
Why does relying on virtual memory slow a computer down?
Virtual memory is in secondary storage, which is slower for the CPU to access than RAM.

Tap any card to flip it, or use Study as deck to go through them one at a time. In the full lesson these run as a spaced-repetition deck — you rate each card Hard, Good or Easy and the tricky ones keep coming back until they stick.

Learning with Lightbulb is opening soon

You can use this lesson now. Join the waitlist and we'll let you know when the full Lightbulb experience is ready.

Keep me posted

More OCR GCSE Computer Science topics

See the full OCR Computer Science curriculum →

How this lesson was checked. This OCR GCSE Computer Science (specification J277)lesson was published through Lightbulb Learning's human-designed editorial process — the educational standards, accuracy rules and publication checks it must pass were authored and approved by Philip Halpin. It passed subject-specific assessment, automated educational checks and technical publication verification before going live (publication checks completed 9 November 2026). Published pages are monitored, human spot-checking is ongoing across the lesson library, and anything found wrong is corrected or withdrawn. How our lessons are made and checked. Spotted a mistake? Email hello@lightbulblearning.co and we'll review it.