{
  "slug": "least-hit-density",
  "term": "Least Hit Density",
  "aliases": [
    "LHD"
  ],
  "definition": "Least Hit Density is a cache replacement policy that ranks objects by predicted hits per byte-access of remaining occupancy.",
  "note": "LHD divides conditional hit probability by object size times expected remaining lifetime. Time is counted in accesses, not seconds; age resets on a reference. Remaining lifetime excludes occupancy already spent. Hit and eviction outcomes both contribute to the lifetime estimate. [lhd-paper]\n\nLHD learns separate distributions of hit and eviction ages for object classes, then conditions on the candidate's current age. Classification can use reference history or application identity. These are estimates, not the next access time of an individual object. [lhd-paper]\n\nThe score is not a request hit ratio or byte hit ratio. For constructed candidates A and B, probabilities 0.8 and 0.4, sizes 100 and 50 bytes, and remaining lifetimes 10 and 2 accesses give 0.0008 and 0.004 hits per byte-access. B has five times the density despite half the hit probability; ignoring lifetime would incorrectly tie them. [worked]\n\nThe released simulator approximates victim selection by sampling and also considering recently admitted objects. It starts with eight sampled candidates, then uses the configured count after more than 50 reconfigurations. Its model accumulates hit and eviction histograms; object size is applied separately when obtaining a rank. [lhd-code] [lhd-header]\n\nIn a constructed completed-lifetime ledger, one hit occupying 100 bytes for 2 accesses and one eviction occupying 100 bytes for 8 accesses yield 1/1000 hits per byte-access. Omitting the eviction overstates density fivefold. [worked]",
  "related": [
    "request-hit-ratio",
    "byte-hit-ratio",
    "cache-admission",
    "lru-replacement",
    "adaptive-replacement-cache"
  ],
  "citations": [
    {
      "id": "lhd-paper",
      "title": "Beckmann, Chen and Cidon. LHD: Improving Cache Hit Rate by Maximizing Hit Density. NSDI 2018, pp. 389-403, sections 3.1-3.5.",
      "url": "https://www.usenix.org/system/files/conference/nsdi18/nsdi18-beckmann.pdf",
      "accessed": "2026-10-30"
    },
    {
      "id": "lhd-code",
      "title": "CMU-CORGI/LHD. lhd.cpp: rank, update and modelHitDensity; commit 806ef466160c5e968efcc60d1e6476ab802f7f55.",
      "url": "https://github.com/CMU-CORGI/LHD/blob/806ef466160c5e968efcc60d1e6476ab802f7f55/lhd.cpp",
      "accessed": "2026-10-30"
    },
    {
      "id": "lhd-header",
      "title": "CMU-CORGI/LHD. lhd.hpp: getHitDensity and simulation parameters; commit 806ef466160c5e968efcc60d1e6476ab802f7f55.",
      "url": "https://github.com/CMU-CORGI/LHD/blob/806ef466160c5e968efcc60d1e6476ab802f7f55/lhd.hpp",
      "accessed": "2026-10-30"
    },
    {
      "id": "lhd-readme",
      "title": "CMU-CORGI/LHD. README: simulation scope and trace requirements; commit 806ef466160c5e968efcc60d1e6476ab802f7f55.",
      "url": "https://github.com/CMU-CORGI/LHD/blob/806ef466160c5e968efcc60d1e6476ab802f7f55/README",
      "accessed": "2026-10-30"
    },
    {
      "id": "worked",
      "title": "Hesela. LHD density accounting: constructed candidates, completed lifetimes and executable arithmetic.",
      "url": "https://hesela.dev/research/lhd-density.json",
      "accessed": "2026-10-30"
    }
  ],
  "provenance": [
    "Source review plus constructed arithmetic, not a replication of LHD hit-rate or RankCache throughput experiments. The public JSON links its calculation module. [worked]",
    "The paper evaluates Memcachier and Microsoft Research traces with workload-specific preparation. Reported savings are not guarantees for other traces, storage tiers or hardware. [lhd-paper]",
    "The CMU-CORGI repository contains an idealized simulator, not the RankCache system implementation. Its README describes a cache without fragmentation. [lhd-readme]"
  ],
  "status": "research",
  "advantages": [],
  "limitations": [
    {
      "text": "The eviction policy influences the observations used for learning; early eviction can hide later reuse. The pinned simulator assigns explorer status only during early reconfigurations and when its remaining exploration budget is positive.",
      "citationIds": [
        "lhd-paper",
        "lhd-code",
        "lhd-header"
      ]
    }
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-10-30"
}
