Memory

💻 Computer Science Years 8–11 Foundation

RAM, ROM, cache and virtual memory: what each stores, whether it is volatile, and how they form a hierarchy.

Open this lesson, with practice and a printable worksheet →

When you open an app, its instructions have to be somewhere the CPU can reach them fast. That somewhere is memory — and there isn't just one kind. From the lightning-fast cache next to the CPU down to the sprawling hard disk, memory forms a hierarchy: the closer to the CPU, the faster, smaller and more expensive it gets.

Why this matters: "My computer is slow — do I need more RAM?" is one of the most common tech questions there is. Knowing what RAM, ROM, cache and virtual memory each do lets you answer it properly instead of guessing.
Registers Cache RAM Secondary storage faster, smaller bigger, cheaper
The memory hierarchy: speed rises as you climb.

RAM — the working desk

power ONdata held(empty)power OFFwiped clean
RAM is volatile — cut the power and everything on the desk is lost.

RAM (Random Access Memory) is the computer's main working memory. When you run a program, it is copied from storage into RAM so the CPU can get at it quickly. RAM is a desk: you lay out what you're working on right now. But RAM is volatile — switch the power off and it's wiped clean, just as clearing the desk loses whatever wasn't filed away.

ROM — the instructions that never change

ROM (Read Only Memory) is non-volatile: it keeps its contents with the power off. It stores the small, permanent program that runs the moment you press the power button — the boot instructions (often called the BIOS) that wake the computer up. You can read ROM but not normally change it, like words printed in a book.

FeatureRAMROM
Can be changed?Yes, read and writeRead only (normally)
Volatile?Yes — loses data without powerNo — keeps data
Typical useRunning programs & open dataBoot / start-up instructions
SizeLarge (e.g. 8–16 GB)Small

Cache and virtual memory

RAM (full)spilldiskvirtual memory (slow)
Full RAM spills onto the disk as virtual memory — it works, but drags.

Cache sits between the CPU and RAM — even faster than RAM, holding the most-used items so the CPU rarely waits. Virtual memory is a clever trick for when RAM runs out: the computer uses part of the hard disk as pretend RAM, moving less-needed data there to free space. It works — but disk is far slower than RAM, so relying on it makes everything drag.

Worked example: You open ten browser tabs and a game, and the computer slows to a crawl. Why? — RAM has filled up, so the computer resorts to virtual memory, shuffling data to the slow hard disk. Adding more RAM would keep more open at once and stop the slowdown.
Common mistake: RAM is not the same as storage. RAM is temporary and volatile; the hard disk or SSD keeps your files permanently. "16 GB of RAM" and "512 GB of storage" describe two completely different things.
RAM 16 GBfast · temporaryvolatileStorage 512 GBslower · permanentnon-volatile≠
Two different things: RAM is your working desk; storage is the filing cabinet.

Tip: remember RAM = Runs Apps Momentarily (volatile), ROM = Read Only (permanent boot code). Virtual memory is the disk pretending to be RAM — a helpful stand-in, never a replacement.

Get the printable worksheet →
← CPU Performance → Secondary Storage
← Sasta Basta home All subjects