What is Conflict miss?

A cache miss caused when several blocks compete for the same set and evict each other even though capacity remains. Higher associativity or shifting data placement reduces it.

Field: Memory Hierarchy

Japanese name: 競合ミス

Mechanism

In most caches, the set in which data may be placed is determined by some bits of its address. The number of lines one set can hold is the associativity. If more data that belongs in the same set is in use than the associativity allows, evictions occur even though other sets are empty. Misses thus occur even though capacity is to spare.

An example

Consider a 32 KB cache in which each set holds only one line. If two arrays whose addresses are exactly a multiple of 32 KB apart are read alternately, they compete for the same place. Each read evicts the other, so every access misses. If each set held two lines, both would fit and the misses would disappear. In a 32 KB cache whose sets hold 8 lines, data a multiple of 4 KB apart falls in the same set. Using nine or more such pieces of data at the same time causes the same thing.

Countermeasures

On the hardware side, the associativity is raised. More candidates must then be compared on each read, however, which costs time and power. Another approach adds a small auxiliary cache that keeps a few lines that have just been evicted. On the software side, padding is inserted between arrays to shift their addresses. Avoiding powers of two for array sizes and for the stride of spaced accesses also helps.

Try it: questions about Conflict miss

Which correctly describes a set-associative cache?

  1. AData for a given address can be placed in any of several locations (ways) within a fixed set
  2. BData for a given address can be placed in only one location in the cache
  3. CData can be placed anywhere in the cache
Show answer and explanation

Answer: A. Data for a given address can be placed in any of several locations (ways) within a fixed set

In a set-associative cache, part of the address selects a set, and data may occupy any of that set's ways—eight candidate slots in an 8-way cache—reducing conflict misses compared with direct mapping. More ways need more comparators and power, so the way count is kept moderate—for example, 8–12 ways for L1 and around 16 for L3. A cache in which data can go anywhere is fully associative.

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.

FAQ

Does it occur in a cache where data can be placed anywhere?

No, because there is no restriction on placement. Misses that occur even in that organization are classified as capacity misses.

Is it related to speed changing from run to run?

It can be. Memory addresses change slightly on each run, so whether data happens to be laid out so as to compete for the same set changes too.

Questions that mention Conflict miss (6)

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

  1. 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?
  2. Which method is effective at reducing the cache misses that occur when a program accesses data for the first time?
  3. Which misses are not reduced even by making a cache fully associative?
  4. What is the effect of increasing a cache's line size?
  5. When each row of a 2D array is 4,096 bytes (a power of two), walking down a column can cause many misses even though the cache has spare capacity. Which countermeasure is effective?
  6. What changes when a cache is switched from direct-mapped to set-associative?

Books on Memory Hierarchy Ad

As an Amazon Associate I earn from qualifying purchases.

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