Memory Hierarchy
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?
- ACompulsory miss
- BCapacity miss
- 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.
- A. Compulsory misses occur only on the first access.
- B. Capacity misses occur when the whole cache is too small.
- C. Correct. It is a conflict miss from competing for the same set.