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.
Press Next for each step. The strip labelled Output logs every move to or from secondary storage.
Why it gets slow
Reason it through
Why does a computer slow down once its RAM is full?
First link · your turn
RAM can't fit everything that's open. What happens to the data that isn't actively being used?
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
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?
RAM is volatile. What does that mean?
Which can the CPU access faster: RAM or secondary storage?
Why can RAM fill up?
What is virtual memory?
When does a computer use virtual memory?
Which data is moved from RAM into virtual memory?
What is data stored as when it is moved into virtual memory?
What happens when the CPU needs a page that is in virtual memory?
Why does relying on virtual memory slow a computer down?
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 postedMore OCR GCSE Computer Science topics
- Optical storage
- Purpose of RAM
- Purpose of ROM
- RAM vs ROM
- Sample rate, duration, bit depth
- Solid state storage
- Sound representation: sampling
- Storage characteristics: capacity, speed, portability, durability, reliability, cost
- Suitable storage for application
- Unicode
- Units of data: bit, nibble, byte
- Why data is stored in binary
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.