{
  "name": "Cache Replacement Policies Comparative Matrix",
  "description": "Empirical and theoretical comparison of major cache replacement policies across memory hierarchies, compiled from gem5 documentation, ChampSim specifications, and USENIX FAST research proceedings.",
  "page": "https://casrai.org/guides/cache-replacement-policy",
  "publisher": "CASRAI",
  "license": "https://creativecommons.org/licenses/by/4.0/",
  "dateModified": "2026-11-29T08:25:00Z",
  "temporalCoverage": null,
  "spatialCoverage": null,
  "columns": [
    {
      "name": "Policy Name",
      "unit": "",
      "description": "Common name and acronym of the replacement policy"
    },
    {
      "name": "Primary Heuristic",
      "unit": "",
      "description": "Core algorithmic heuristic used to evaluate candidate blocks"
    },
    {
      "name": "State Overhead",
      "unit": "bits/block",
      "description": "Tracking metadata required per cache line"
    },
    {
      "name": "Hit Complexity",
      "unit": "",
      "description": "Algorithmic time complexity to update metadata on a cache hit"
    },
    {
      "name": "Eviction Complexity",
      "unit": "",
      "description": "Algorithmic time complexity to identify and remove a victim"
    },
    {
      "name": "Scan Resistance",
      "unit": "",
      "description": "Resilience against working-set pollution from one-time linear scans"
    },
    {
      "name": "Hardware Viability",
      "unit": "",
      "description": "Feasibility and prevalence in physical microarchitecture implementations"
    }
  ],
  "rows": [
    {
      "Policy Name": "Optimal (Bélády MIN)",
      "Primary Heuristic": "Future re-reference distance",
      "State Overhead": "Theoretical (unimplementable)",
      "Hit Complexity": "O(1)",
      "Eviction Complexity": "O(N)",
      "Scan Resistance": "Immune",
      "Hardware Viability": "Theoretical benchmark only"
    },
    {
      "Policy Name": "Least Recently Used (LRU)",
      "Primary Heuristic": "Recency of last access",
      "State Overhead": 4,
      "Hit Complexity": "O(1)",
      "Eviction Complexity": "O(1)",
      "Scan Resistance": "Vulnerable to thrashing",
      "Hardware Viability": "High complexity for 8+ ways"
    },
    {
      "Policy Name": "First-In, First-Out (FIFO)",
      "Primary Heuristic": "Arrival timestamp order",
      "State Overhead": 0,
      "Hit Complexity": "O(1)",
      "Eviction Complexity": "O(1)",
      "Scan Resistance": "Vulnerable to scans and anomaly",
      "Hardware Viability": "Trivial (circular pointer)"
    },
    {
      "Policy Name": "Least Frequently Used (LFU)",
      "Primary Heuristic": "Access reference frequency",
      "State Overhead": 8,
      "Hit Complexity": "O(1)",
      "Eviction Complexity": "O(1) with min-heap/tree",
      "Scan Resistance": "Vulnerable to frequency stagnation",
      "Hardware Viability": "Complex tracking overhead"
    },
    {
      "Policy Name": "Tree Pseudo-LRU (TreePLRU)",
      "Primary Heuristic": "Binary decision tree approximation",
      "State Overhead": 1,
      "Hit Complexity": "O(log N)",
      "Eviction Complexity": "O(log N)",
      "Scan Resistance": "Vulnerable to thrashing",
      "Hardware Viability": "Standard in L1/L2 hardware"
    },
    {
      "Policy Name": "Adaptive Replacement Cache (ARC)",
      "Primary Heuristic": "Self-tuning recency vs frequency",
      "State Overhead": 2,
      "Hit Complexity": "O(1)",
      "Eviction Complexity": "O(1)",
      "Scan Resistance": "Resistant (dynamic tuning parameter)",
      "Hardware Viability": "Software and storage buffer pools"
    },
    {
      "Policy Name": "LRU Insertion Policy (LIP)",
      "Primary Heuristic": "Bimodal insertion at LRU position",
      "State Overhead": 4,
      "Hit Complexity": "O(1)",
      "Eviction Complexity": "O(1)",
      "Scan Resistance": "High scan resistance",
      "Hardware Viability": "Moderate microarchitecture overhead"
    },
    {
      "Policy Name": "Static RRIP (SRRIP)",
      "Primary Heuristic": "2-bit Re-reference interval prediction",
      "State Overhead": 2,
      "Hit Complexity": "O(1)",
      "Eviction Complexity": "O(1)",
      "Scan Resistance": "High scan and thrash resistance",
      "Hardware Viability": "Widely deployed in commercial LLCs"
    },
    {
      "Policy Name": "Random Replacement (RR)",
      "Primary Heuristic": "Uniform pseudorandom selection",
      "State Overhead": 0,
      "Hit Complexity": "O(1)",
      "Eviction Complexity": "O(1)",
      "Scan Resistance": "Moderate (no scan vulnerability)",
      "Hardware Viability": "Minimal hardware cost"
    }
  ],
  "sources": [
    {
      "title": "gem5: Replacement Policies",
      "url": "https://www.gem5.org/documentation/general_docs/memory_system/replacement_policies/",
      "accessed": "2026-11-19"
    },
    {
      "title": "The ChampSim Module System — ChampSim documentation",
      "url": "https://champsim.github.io/ChampSim/master/Modules.html",
      "accessed": "2026-11-19"
    },
    {
      "title": "ARC: A Self-Tuning, Low Overhead Replacement Cache",
      "url": "https://www.usenix.org/legacy/event/fast03/tech/full_papers/megiddo/megiddo.pdf",
      "accessed": "2026-11-19"
    }
  ]
}