Random access memory (RAM) explained
Random access memory (RAM) is a computer's main working memory. It holds the programs and data in use right now, such as your open browser tabs and the game you are playing, so the CPU can read them quickly. RAM is volatile: everything in it is lost when the power goes off, which is why your files live on a drive instead.
What does RAM do?
When you open an app, its instructions and data are copied from the drive into RAM. The CPU then works through those instructions in the fetch, decode, execute cycle: each instruction is brought in from memory, worked out and then carried out, with results written back as it goes. Everything the CPU is working on passes through RAM, because reading straight from a drive would be far too slow.
"Random access" means the CPU can go straight to any location by its address, and every location takes about the same time to reach. That is unlike a tape, where you have to wind past everything before the part you want.
Volatile and non-volatile
Volatile memory needs power to keep its contents. RAM stores each bit as a tiny electrical charge, so when the power goes, the data goes. Non-volatile memory, such as ROM, an SSD or a hard drive, keeps its data with the power off. The AQA GCSE Computer Science specification asks you to explain both terms.
RAM vs ROM
| RAM | ROM | |
|---|---|---|
| Stands for | Random access memory | Read-only memory |
| Volatile? | Yes: loses its contents without power | No: keeps its contents without power |
| Holds | The programs and data in use right now | The start-up instructions (firmware) that run when the computer is switched on |
| Changes | All the time, as programs run | Rarely or never in normal use |
| Size in a PC | Gigabytes | Megabytes |
Both are main memory: memory the CPU can reach directly. When you press the power button, the CPU runs the firmware from a chip on the motherboard, which checks the hardware and then loads the operating system from the drive into RAM.
RAM vs storage
A phone advertised with "256 GB" usually means storage, not RAM. They do different jobs. Storage keeps everything permanently, and RAM holds the part you are using, much faster. These rough read times come from the PC Components course:
| Memory | Typical read time | Volatile? | Size |
|---|---|---|---|
| CPU cache (L1) | About 1 nanosecond | Yes | Kilobytes to tens of megabytes |
| RAM | About 90 nanoseconds | Yes | Gigabytes |
| NVMe SSD | About 0.1 milliseconds | No | Hundreds of gigabytes to terabytes |
| Hard drive | About 10 milliseconds | No | Terabytes |
A hard drive read at 10 ms is about 110,000 times slower than a RAM read at 90 ns. Each step away from the CPU is bigger and cheaper per gigabyte, but slower. This is the memory hierarchy.
Cache: memory on the CPU
Even RAM is slow to a modern CPU. At 5 GHz a core ticks 5 billion times a second, so one 90 ns trip to RAM costs 450 ticks. The CPU keeps copies of recently used data in its cache, a small, very fast memory on the chip. Finding data there is a hit; having to go to RAM is a miss. If 95% of reads hit a 1 ns cache and the rest go to 90 ns RAM, the average read takes 0.95 × 1 + 0.05 × 90 = 5.45 ns. A bigger cache means more hits, which is why cache size is one of the three things the AQA specification says affect CPU performance, with clock speed and the number of cores.
DRAM and SRAM
- DRAM (dynamic RAM) stores each bit as charge in a tiny capacitor, controlled by a transistor. The charge leaks away, so every cell has to be read and rewritten, called refreshing, many times a second. It is dense and cheap, so it is used for the RAM sticks in a PC.
- SRAM (static RAM) stores each bit in a small circuit of transistors called a flip-flop, which holds its value without refreshing as long as it has power. It is faster but takes more space per bit and costs more, so it is used for CPU cache.
RAM speed and bandwidth
Desktop PCs in 2026 use DDR5 memory. A speed such as DDR5-6000 means 6,000 million transfers a second (MT/s), and each transfer moves 8 bytes. Two sticks in the right slots run in dual channel, so the CPU reads both at once and the bandwidth doubles:
For DDR5-6000 in one channel: 6,000 × 8 = 48,000 MB/s, or 48 GB/s. In dual channel that becomes 96 GB/s. That is why two 16 GB sticks are usually better than one 32 GB stick: the same amount of RAM, twice the bandwidth.
Try one with a random speed, then press Mark to check it in the course:
Type the bandwidth in GB/s for a random DDR5 speed in single or dual channel (MathAnswerInput).
Press Mark to have your answer marked in the PC Components course.
What happens when RAM runs out?
If the programs you have open need more memory than you have, the operating system moves parts that are not being used right now out to the drive, and treats that space as extra memory. This is called virtual memory. It stops programs crashing, but the drive is thousands of times slower than RAM, so the computer slows down as data is swapped back and forth. Closing programs or adding RAM fixes it.
Common mistakes
- Calling storage "memory". RAM is memory; an SSD or hard drive is storage.
- Saying RAM keeps data when switched off. It is volatile. ROM and storage are non-volatile.
- Thinking more RAM always makes a computer faster. It helps when RAM is running out. Beyond what your programs need, extra RAM sits unused.
- Mixing up cache and RAM. Cache is a small, faster memory on the CPU that holds copies of data from RAM.
Common questions
What is RAM in simple terms?
What is the difference between RAM and ROM?
Why is RAM called random access?
Is RAM volatile or non-volatile?
What is the difference between RAM and storage?
What does dual channel RAM mean?
Revision cards
Say the answer first, then flip the card to check it.
Where to go next
- Solve it
CPU Simulator
Step through fetch, decode and execute in assembly
Open the tool - Learn it
PC Components
CPUs, GPUs and RAM: understand what makes a computer tick
Start the course - Test it
GCSE Computer Science
A new exam-style paper every day, with instant marking and a mark scheme
Start today's paper