DRAM vs SRAM: How the Two Main Memory Types Differ
DRAM stores each bit as a charge in a capacitor that needs constant refreshing; SRAM stores each bit in a transistor circuit that holds its state.
DRAM (dynamic random-access memory) stores each bit as a tiny electrical charge in a capacitor, which leaks away and must be refreshed thousands of times a second to avoid losing data. SRAM (static random-access memory) stores each bit in a small circuit of transistors that holds its state as long as power is supplied, with no refreshing needed. That single structural difference — a leaky capacitor versus a self-holding circuit — explains why one is cheap and dense enough to serve as a computer’s main memory, and the other is fast and expensive enough to serve only as a CPU’s cache.
How each cell actually stores a bit
A DRAM cell is about as simple as a memory cell can get: one transistor and one capacitor. The capacitor’s charge (or lack of it) represents a 1 or a 0. That simplicity is exactly why DRAM is so dense — millions of these one-transistor cells pack onto a chip — but the capacitor’s charge drains within milliseconds, so a memory controller has to periodically read and rewrite every cell just to keep the stored values from disappearing. This background refresh cycle is where the “dynamic” in DRAM comes from: the data isn’t stable on its own, it has to be actively maintained.
An SRAM cell typically uses six transistors arranged as a pair of cross-coupled inverters — a small feedback circuit that locks into one of two stable states and stays there as long as it has power, no refresh required. That stability is where “static” comes from. The cost is size: six transistors per bit take up far more silicon area than DRAM’s one transistor and one capacitor, which is the direct reason SRAM can’t be packed nearly as densely.
The consequences: speed, density, cost
That structural tradeoff cascades into everything else about how the two are used.
SRAM is faster because there’s no refresh overhead and no need to sense a fading capacitor charge precisely — reading a stable transistor state is quicker and more reliable. It’s also more expensive per bit, both because six transistors take more silicon than one transistor-plus-capacitor, and because that lower density means fewer bits fit on a given chip area.
DRAM is denser and cheaper per bit, which is exactly what you want for the large pool of memory a system needs to hold a running program’s working data — but it’s slower, and the constant refresh cycle consumes power and periodically makes cells briefly unavailable while they’re being refreshed.
| DRAM | SRAM | |
|---|---|---|
| Cell structure | 1 transistor + 1 capacitor | ~6 transistors (cross-coupled) |
| Needs refreshing | Yes, continuously | No |
| Speed | Slower | Faster |
| Density (bits per unit area) | High | Low |
| Cost per bit | Low | High |
| Typical role | Main system memory (RAM) | CPU cache |
Why CPUs use SRAM for cache and DRAM for main memory
A CPU cache exists to hide the latency of main memory, so it has to be dramatically faster than the memory it’s shielding the processor from — which rules out DRAM for that role regardless of cost. CPU cache levels (L1, L2, L3) are all built from SRAM, with L1 (the smallest and fastest, sitting closest to the processor core) using the most silicon area per bit of any cache level, trading density for the lowest possible latency.
Main memory has the opposite priority. A modern system needs many gigabytes of RAM to hold running programs and their data, and building that much memory out of SRAM would be prohibitively expensive and physically enormous — SRAM’s density disadvantage compounds directly with the sheer quantity of memory needed. DRAM’s density and lower cost per bit make it the only practical choice at that scale, and the system tolerates its higher latency because the cache hierarchy sitting in front of it absorbs most of the requests that would otherwise hit main memory directly.
This is really the same tradeoff explored in why memory bandwidth and latency aren’t the same thing: a system layers several memory technologies, each suited to a different point on the speed-versus-capacity curve, rather than trying to build one memory type that’s simultaneously fast, dense, and cheap — which isn’t physically achievable with either cell design.
Where each shows up beyond the CPU
DRAM’s role isn’t limited to a computer’s main RAM sticks — GPU memory (relevant to anything doing heavy parallel computation) is also DRAM-based, just built with different interfaces optimized for bandwidth rather than latency, such as HBM rather than GDDR in high-end accelerators. SRAM shows up anywhere a small amount of very fast, non-refreshing storage is worth the area cost: not just CPU caches, but also registers, TLBs (translation lookaside buffers), and other small on-chip structures that need to respond in a single clock cycle or close to it.
The takeaway
DRAM and SRAM store bits in fundamentally different ways — a leaky capacitor that needs constant refreshing versus a self-holding transistor circuit — and that single difference explains why they’re used so differently. DRAM’s density and low cost per bit make it the right choice for the large pool of main system memory a computer needs; SRAM’s speed and stability, paid for with a much higher cost per bit, make it the right choice for the small, fast caches sitting between a processor and that main memory.
Tagged
Keep reading
Chisato · · 4 min read What Is SerDes? Serializer/Deserializer Chips Explained
SerDes converts parallel data to a serial stream for transmission and back, letting chips move data over fewer, faster wires with less overhead.
Chisato · · 4 min read Von Neumann vs Harvard Architecture Explained
Von Neumann shares one memory for code and data; Harvard architecture splits them. How the two computer architectures differ, and where each is used.
Chisato · · 5 min read Cache Coherence and the MESI Protocol, Explained
Cache coherence keeps each CPU core's private cache consistent with the others. The MESI protocol is the classic mechanism that makes it work.