Course contentsShow
← Computer Science
Lesson 1142 of 2,87226. Memory Hierarchy and CachingFree lesson

Types of Cache Misses: Compulsory

Understand compulsory (cold-start) misses that occur on first access to a memory block.

Types of Cache Misses: Compulsory

What You'll Learn

You'll understand why the very first access to any memory block always results in a cache miss, no matter how perfect your cache design is.

The Inevitable First Miss

A compulsory miss (also called a cold-start miss or first-reference miss) occurs when a program accesses a memory block for the very first time. Since the cache starts empty and has never seen this data before, it cannot possibly contain it yet—guaranteeing a miss.

Think of it like opening a new book. The first time you need information from page 42, you must turn to that page—there's no shortcut. Only after you've visited that page once can you bookmark it for faster access later.

Why They're Called "Compulsory"

These misses are unavoidable regardless of:

  • How large your cache is
  • What associativity you choose (direct-mapped, set-associative, or fully associative)
  • Which replacement policy you use

Every program experiences compulsory misses when it starts running or when it touches a new region of memory for the first time.

Impact on Cache Performance

Compulsory misses are typically a small fraction of total misses in long-running programs because:

  • They only happen once per unique memory block
  • Programs often reuse the same data many times (thanks to locality of reference)
  • As execution continues, more blocks become "warm" in the cache

However, they can dominate performance in short programs or during program startup phases.

Key Takeaway: Compulsory misses are the unavoidable "first contact" misses that occur when accessing any memory block for the first time—no cache design can eliminate them.