What is Average memory access time?
The average time per memory access, computed as hit time + miss rate × miss penalty. A basic metric for comparing cache designs.
Field: Memory Hierarchy
Read the beginner explainer: How Does CPU Cache Work? Hit Rate, Lines and Locality
Japanese name: 平均メモリアクセス時間(AMAT)
The basic formula
Average memory access time (AMAT) equals hit time plus miss rate multiplied by miss penalty. The hit time is paid on every access, because the cache must be checked first, while the miss penalty, the extra time to fetch the block from the next level, is added only for the fraction of accesses that miss. With a 2-cycle hit time, a 4% miss rate and a 150-cycle miss penalty, AMAT is 2 + 0.04 × 150 = 8 cycles. Even a small miss rate can multiply the average many times over.
Applying it to multi-level caches
With several cache levels, the formula is applied recursively: the L1 miss penalty is the average access time of L2. Using an L1 hit time of 1 ns and miss rate of 5%, an L2 hit time of 10 ns and local miss rate of 20%, and 100 ns main memory, the L2 average is 10 + 0.2 × 100 = 30 ns, so AMAT = 1 + 0.05 × 30 = 2.5 ns. The L2 local miss rate counts misses among accesses reaching L2; the global miss rate, 0.05 × 0.2 = 1%, counts them among all accesses.
Why miss rate alone misleads
Larger or more associative caches lower the miss rate but often lengthen the hit time. Compare a cache with a 1-cycle hit and 5% miss rate against one with a 2-cycle hit and 4% miss rate, both with a 20-cycle miss penalty: AMAT is 2.0 versus 2.8 cycles, so the cache with fewer misses is slower. Designers therefore work on three levers together: shorten hit time with small, simple L1 caches, reduce miss rate with capacity, associativity and prefetching, and reduce miss penalty with additional cache levels.
Limits of the metric
AMAT is a clean way to compare memory hierarchies, but it is not the same as program run time. Out-of-order processors can keep executing independent instructions and overlap several outstanding misses, so not all of the miss penalty turns into stall time. To estimate CPU time, memory stall cycles are usually expressed per instruction, as memory accesses per instruction times miss rate times miss penalty. Miss rates for these calculations are typically obtained from simulation or from hardware performance counters.
Try it: questions about Average memory access time
- A2.0 ns
- B2.5 ns
- C6.0 ns
Show answer and explanation
Answer: B. 2.5 ns
The L1 miss penalty is the L2 average access time, 10 + 0.2 × 100 = 30 ns. The average memory access time is therefore 1 + 0.05 × 30 = 1 + 1.5 = 2.5 ns. 2.0 ns forgets the 10 ns L2 hit time, computing 1 + 0.05 × (0.2 × 100). 6.0 ns multiplies the 100 ns memory time directly by the L1 miss rate, ignoring the L2.
- A8 cycles
- B6 cycles
- C152 cycles
Show answer and explanation
Answer: A. 8 cycles
Average memory access time = hit time + miss rate × miss penalty = 2 + 0.04 × 150 = 2 + 6 = 8 cycles. The hit time applies to every access, and the miss penalty is added only on misses. 6 cycles omits the hit time, counting only the misses. 152 cycles is the time for a single access that misses, not the average. Even a 4% miss rate quadruples the average.
FAQ
What is the formula for average memory access time?
AMAT = hit time + miss rate × miss penalty. For multi-level caches, the miss penalty of each level is itself the AMAT of the next level.
What is the difference between local and global miss rate?
The local miss rate of a cache is its misses divided by the accesses that reach it, while the global miss rate divides those misses by all accesses issued by the processor; the global L2 rate equals the L1 miss rate times the L2 local miss rate.
Can a lower miss rate give a higher AMAT?
Yes. If reducing misses requires a longer hit time, the extra time paid on every access can outweigh the savings on the few accesses that would have missed.
Books on Memory Hierarchy Ad
As an Amazon Associate I earn from qualifying purchases.
Comparisons that include this term
Semiconductor, Electronics and Computing Calculators
This page was drafted with AI and fact-checked by a separate AI review before publication. Our Editorial policy explains how we write and check content. If you spot an error, please tell us on our Contact page.
Back to the glossary