{
  "slug": "lirs-replacement",
  "term": "Low inter-reference recency set replacement",
  "aliases": [
    "LIRS",
    "Low Inter-reference Recency Set"
  ],
  "definition": "LIRS is a cache-replacement policy that protects low inter-reference-recency blocks while retaining some evicted-block history.",
  "note": "Inter-reference recency (IRR) counts distinct intervening blocks between consecutive accesses; it is not elapsed time or the number of repeated requests. [lirs05]\n\nLIR blocks stay resident until demotion. After the LIR allocation fills, first-seen blocks enter as HIR; eviction selects from the resident HIR queue Q. [lirs02]\n\nStack S tracks LIR entries and selected HIR history, including nonresident entries. Pruning removes bottom HIR entries until an LIR entry is reached; removing history from S does not itself evict a resident HIR block from Q. [lirs02]\n\nAn access to a resident HIR block is a hit; an access to a nonresident HIR entry is still a miss and needs a fetch. If the HIR entry was already in S, it becomes LIR and the bottom LIR entry is demoted. Otherwise it remains HIR and moves to the recent end of Q. On a miss, Q supplies the victim before promotion; demotion keeps the former LIR block resident in Q. [lirs05]\n\nEvery accessed block moves to the top of S. A resident HIR block outside S remains HIR on that access but re-enters S, so a later access before pruning can qualify it for promotion. An LIR hit at the previous bottom of S triggers pruning. [lirs05]\n\nCLOCK-Pro adapts the reuse-history principle to reference-bit sampling and changes its cold-page allocation dynamically. It is not the same per-access stack algorithm. [clockpro]",
  "status": "research",
  "advantages": [
    {
      "text": "A scan need not replace protected reusable blocks merely because its one-time blocks were accessed more recently.",
      "citationIds": [
        "lirs02"
      ]
    }
  ],
  "limitations": [
    {
      "text": "The fixed HIR allocation trades protected capacity against responsiveness; a setting suitable for loops can lose hits on strongly localized workloads.",
      "citationIds": [
        "clockpro"
      ]
    },
    {
      "text": "Trace-simulation hit ratios do not establish present-day end-to-end latency, implementation overhead or a universal ranking.",
      "citationIds": [
        "lirs05",
        "clockpro"
      ]
    },
    {
      "text": "Ordinary stack pruning does not impose a fixed metadata budget: bursts of first-time references can enlarge S. A separately capped variant removes HIR history near the bottom, trading retained history for bounded metadata.",
      "citationIds": [
        "lirs02"
      ]
    }
  ],
  "related": [
    "lru-replacement",
    "reuse-distance",
    "clock-pro",
    "ghost-cache-entry",
    "cache-pollution"
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-03",
  "citations": [
    {
      "id": "lirs02",
      "title": "Jiang and Zhang. LIRS: An Efficient Low Inter-reference Recency Set Replacement Policy. Author-hosted TR-02-6, sections 3.1-3.3 and 5.3.",
      "url": "https://xiaodongzhang1911.github.io/Zhang-papers/TR-02-6.pdf",
      "accessed": "2026-11-03"
    },
    {
      "id": "lirs05",
      "title": "Jiang and Zhang. Making LRU Friendly to Weak Locality Workloads. IEEE TC 54(8), 939-952 (2005), sections 1.2, 3.3 and 4.",
      "url": "https://ranger.uta.edu/~sjiang/pubs/papers/jiang05_LIRS.pdf",
      "accessed": "2026-11-03"
    },
    {
      "id": "clockpro",
      "title": "Jiang, Chen and Zhang. CLOCK-Pro: An Effective Improvement of the CLOCK Replacement. USENIX ATC 2005, sections 2.2, 4 and 5.",
      "url": "https://usenix.org/legacy/events/usenix05/tech/general/full_papers/jiang/jiang_html/html.html",
      "accessed": "2026-11-03"
    }
  ],
  "provenance": [
    "Primary-source synthesis, not a benchmark replication or a claim about a current kernel policy. The 2002 report and 2005 extension are distinguished."
  ]
}
