What is RAM?
RAM stands for Random Access Memory. It is where your computer keeps the programs and data it is currently using. When you open a web browser, edit a document, or play a game, that software is loaded from storage (your hard drive or SSD) into RAM so the CPU can access it quickly.
RAM is much faster to read from than a hard drive, but it is also volatile — it loses all its data when the power is switched off. That is why you need to save your work before shutting down!
RAM does not store your files permanently. If your computer loses power without saving, anything only in RAM (like an unsaved document) will be lost. Always save your work!
RAM vs Storage
It is very important not to confuse RAM with storage (hard drives or SSDs):
| Feature | RAM | Storage (HDD/SSD) |
|---|---|---|
| Speed | Very fast | Slower (SSD) / Much slower (HDD) |
| Capacity | 4 – 64 GB (typical) | 256 GB – several TB |
| Volatile? | Yes (loses data on power off) | No (permanent storage) |
| Used for | Running programs actively | Storing files long-term |
How Much RAM Do You Need?
RAM is measured in gigabytes (GB). The more RAM your computer has, the more programs it can run at the same time without slowing down.
| RAM Amount | Typical Use |
|---|---|
| 4 GB | Basic tasks: browsing, documents |
| 8 GB | Comfortable multitasking, most games |
| 16 GB | Video editing, demanding games |
| 32 GB+ | Professional video/3D work |
When you run out of RAM, the operating system uses part of the hard drive as "virtual memory" (called a page file or swap space). This works, but it is much slower, causing the computer to lag.
"Random Access" in RAM means the CPU can read any memory location in the same amount of time, regardless of where it is. This is different from a magnetic tape, where you have to scroll to find data.
Types of RAM
The main type of RAM in modern computers is DRAM (Dynamic RAM), which constantly needs to be refreshed (re-written) to keep its data. Inside the CPU, there is a small amount of SRAM (Static RAM) — this is faster but much more expensive and is used for the CPU cache.
What Happens When You Run a Program?
- You double-click an application
- The OS loads the program's code from storage into RAM
- The CPU reads instructions from RAM and executes them
- As you work, data is read from and written to RAM
- When you save, data is written back to storage
Practice Problems
Explain the difference between RAM and a hard drive. Why does a computer need both?
Show answer
A student's computer has 4 GB of RAM. They open many browser tabs, a game, and a music player at the same time and notice the computer becomes very slow. Explain what is likely happening.