💾
beginner·7 min read

How Does RAM Work?

RAM (Random Access Memory) is your computer's working memory — the fast, temporary storage that holds the OS, open applications and active data while the system is running. Unlike storage (SSD/HDD), RAM loses its contents when powered off. The CPU reads and writes to RAM constantly; insufficient RAM forces the system to swap data to the much slower SSD, causing severe performance degradation.

How DRAM Cells Store Data

Dynamic RAM stores each bit as a tiny electric charge in a capacitor paired with a transistor. Because capacitors leak charge, DRAM must be refreshed thousands of times per second — that's where "dynamic" comes from (SRAM, used in CPU cache, doesn't need refreshing but requires 6 transistors per bit vs 1). A DRAM chip contains billions of these capacitor cells arranged in rows and columns. To read a bit, the memory controller opens (activates) the row, reads the capacitor's charge, and amplifies it via a sense amplifier.

  • ▸DRAM density is higher than SRAM — cheaper per bit, so we can afford gigabytes of it.
  • ▸The refresh operation is why idle DRAM still consumes some power; LPDDR reduces refresh rate to save power in mobile devices.

DDR Generations: DDR4 vs DDR5

DDR (Double Data Rate) transfers data on both the rising and falling edges of the clock signal, doubling effective bandwidth vs the clock rate. DDR5 introduced major architectural changes: dual 32-bit sub-channels (vs a single 64-bit in DDR4), on-die ECC, on-die voltage regulation (VDD moved from motherboard to DIMM) and higher base speeds starting at 3200 MT/s up to 8800 MT/s JEDEC spec. The result is roughly 1.5–2× the bandwidth of DDR4 at comparable speeds.

SpecDDR4DDR5
Base speed1600–2133 MT/s3200–4800 MT/s (JEDEC base)
Max mainstream~5600 MT/s OC~8800 MT/s (JEDEC)
Channel width64-bit2 × 32-bit sub-channels
On-die ECCNoYes
Voltage1.2 V1.1 V (lower for base)
Bandwidth (3200 MT/s)~51 GB/sN/A
Bandwidth (6000 MT/s)N/A~96 GB/s

Timings and Latency

DDR memory specs include timings like CL36-38-38-76. CL (CAS Latency) is the most important — it's the number of clock cycles between requesting data and receiving it. Lower CL = faster response. But higher-speed RAM can still have lower absolute latency if the cycle time is short enough. Absolute latency = (CL / speed_in_MT/s) × 2000 ns. For example, DDR5-6000 CL30 gives 10 ns absolute CAS latency, better than DDR4-3200 CL16 at 10 ns — they're about equal. Gaming is sensitive to absolute latency.

  • ▸XMP (Intel) / EXPO (AMD) are profiles stored on the DIMM that tell the motherboard to run at the rated advertised speed automatically.
  • ▸Without XMP/EXPO enabled, most DIMMs run at JEDEC default speeds (slower than the box speed).

Channels, Capacity and Gaming

Modern CPUs benefit from dual-channel memory — two DIMMs installed in matched pairs, doubling theoretical bandwidth. Some enthusiast platforms support quad-channel. For gaming, 16–32 GB DDR5 in dual-channel is ideal. CPU-integrated graphics (Intel Arc, AMD Radeon iGPU, Apple Silicon) share system RAM and benefit enormously from faster, dual-channel memory since there is no dedicated VRAM. AI inference on Apple M-series Macs is similarly bandwidth-bound — the reason M4 Ultra with 192 GB unified memory competes with high-end AI accelerators.

Note: LPDDR5X is the mobile equivalent of DDR5. It is soldered to the motherboard (not user-upgradeable) and runs at 7500–8533 MT/s, used in flagship smartphones and thin laptops like the MacBook Air.
RAMDDR5MemoryHardware basicsDRAM