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.
RAM — the working desk
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.
| Feature | RAM | ROM |
|---|---|---|
| Can be changed? | Yes, read and write | Read only (normally) |
| Volatile? | Yes — loses data without power | No — keeps data |
| Typical use | Running programs & open data | Boot / start-up instructions |
| Size | Large (e.g. 8–16 GB) | Small |
Cache and virtual memory
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.
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.