What is Capacity miss?

A cache miss caused by the working set being larger than the cache. It occurs even in a fully associative cache and is reduced by a larger cache or by improving data reuse.

Field: Memory Hierarchy

Japanese name: 容量ミス

What kind of miss it is

The set of data a program uses repeatedly over a period is called its working set. If it does not fit in the cache, data still in use is evicted and misses when used next. A capacity miss is a miss that occurs even in the most flexible cache organization, where data can be placed anywhere. This distinguishes it from a conflict miss, which is caused by restrictions on placement.

An example and hardware countermeasures

Consider repeatedly scanning a 1 MB array with a 32 KB L1 cache. While the later part of the array is being read, the earlier part is evicted. A miss therefore occurs again at every new line, even on the second and later scans. A larger cache reduces misses, but a large cache takes longer to read. The cache is therefore built as a hierarchy: a small, fast L1, a larger L2 and a still larger L3. Much of the data that misses in L1 is found in L2 or L3.

Software countermeasures

In computations on large matrices, rather than sweeping over the whole at once, the work is divided into small blocks that fit in the cache and finished block by block. This technique is called cache blocking. Making the data itself smaller also helps. Separating frequently used fields and rarely used fields into different arrays lets more of the frequently used data fit in the same capacity. Combining operations on the same data into a single pass also reduces misses.

Try it: questions about Capacity miss

Which correctly lists the "three Cs" classification of cache misses?

  1. AWrite, read and branch misses
  2. BClock, voltage and temperature misses
  3. CCompulsory, capacity and conflict misses
Show answer and explanation

Answer: C. Compulsory, capacity and conflict misses

Cache misses are classified as compulsory (first access), capacity (evicted because the cache is too small) and conflict (competition for the same set). Remedies differ by cause: larger lines or prefetching for compulsory misses, a bigger cache for capacity misses, and higher associativity for conflict misses.

In a direct-mapped cache, elements of two arrays map to the same cache location and evict each other on every alternating access. How is this miss classified?

  1. ACompulsory miss
  2. BCapacity miss
  3. CConflict miss
Show answer and explanation

Answer: C. Conflict miss

Misses where two pieces of data fight over the same set and evict each other, even though the cache as a whole has room, are conflict misses. Raising associativity so a set can hold both, or offsetting one array so it maps to different sets, reduces them. Capacity misses arise because the working set exceeds the whole cache and persist even with full associativity. Compulsory misses happen on first access and do not describe repeated accesses.

FAQ

How is it told apart from a conflict miss?

If raising the associativity of the cache reduces the misses, they are conflict misses; if only more capacity reduces them, they are capacity misses. In practice they are classified with tools that simulate cache behavior.

Does the same thing happen in a TLB?

Yes. Using a range larger than the number of TLB entries multiplied by the page size increases TLB misses. Using large pages widens the range each entry covers.

Questions that mention Capacity miss (4)

Capacity miss appears in 6 practice questions across 2 topics, including Memory Hierarchy, CPUs and architecture.

  1. Which method is effective at reducing the cache misses that occur when a program accesses data for the first time?
  2. Which misses are not reduced even by making a cache fully associative?
  3. What is the main purpose of loop blocking (tiling), used for example in matrix multiplication?
  4. What is the main effect of a victim cache, a small fully associative buffer that temporarily holds lines evicted from the L1 cache?

Books on Memory Hierarchy Ad

As an Amazon Associate I earn from qualifying purchases.

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