Electronics
Memory (RAM)
When someone says "this machine has 16 GB of RAM," this is what they mean — the fast, working memory a CPU actively reads and writes while a program runs. It's a completely different thing from storage, in one way that matters more than any speed or capacity number: what happens when the power goes off.
- What it is
- Fast, volatile working memory the CPU actively uses while running — cleared entirely on power loss.
- Mental model
- A desk you're actively working at — everything within arm's reach for as long as you're there, but cleared the moment you leave the room.
- Key numbers
- Measured in GB; current generations are DDR4/DDR5. Volatile: content is gone the instant power is lost.
- Reach for it when
- Describing how much active data/how many running programs a system can hold at once — not how much it can permanently keep.
Volatile — the defining property
RAM's single defining trait is that it's volatile: every bit it holds vanishes the instant power is removed. That's the direct, deliberate contrast with ROM and storage — this page is fast because it doesn't have to guarantee anything survives past the next power cycle, a guarantee non-volatile memory has to work much harder (and slower) to provide.
DRAM vs. SRAM
- DRAM
- What "RAM" almost always means in practice — a capacitor per bit that leaks charge and must be constantly refreshed thousands of times a second. Cheap and dense, which is why it's used for a system's main memory, measured in GB.
- SRAM
- Built from transistor latches instead of capacitors — no refresh needed, meaningfully faster, but far more expensive and less dense per chip area. Used for CPU cache and for a microcontroller's own small internal RAM, where every extra nanosecond of latency and every microwatt of power actually matters.
Why more RAM helps
When active data no longer fits in RAM, the operating system starts swapping — temporarily writing some of it out to much slower storage to make room, then reading it back when needed again. This is the actual mechanism behind "why is my computer crawling with 50 browser tabs open" — not the CPU struggling, but RAM running out and the system falling back to a component hundreds of times slower to compensate.
Where memory sits in the hierarchy
CPU registers and cache are faster and smaller than RAM; storage is far larger and far slower. RAM is the middle tier — big enough to hold an entire running program's active data, fast enough that the CPU isn't constantly stalled waiting on it, but not fast enough to skip cache, and not persistent enough to skip storage.
Real-world applications
- Every general-purpose computer — desktops, laptops, servers, phones — measured directly in the GB spec sheets advertise.
- Database and cache servers — systems specifically built to hold enormous datasets in RAM for the speed of never having to touch disk during normal operation.
- Embedded microcontrollers — a tiny amount of on-chip SRAM (often just KB, not GB) holds a running firmware's variables and stack — see the Embedded C domain for how that space actually gets divided up in a running program.
Gotchas
- RAM is not storage — unsaved work vanishing after a crash or power loss is RAM's volatility working exactly as designed, not a bug.
- RAM speed (MHz, timings like CL) matters far less than capacity for most workloads, right up until a system actually runs out — at which point capacity dominates every other consideration.
- ECC (error-correcting) RAM exists specifically for systems — servers, safety-relevant embedded devices — where a single cosmic-ray-induced bit flip is unacceptable; consumer RAM has no such protection, and it's invisible until it very occasionally isn't.