{
  "slug": "greedy-garbage-collection",
  "term": "Greedy garbage collection",
  "aliases": [
    "greedy block cleaning"
  ],
  "definition": "A flash block-cleaning policy that selects a candidate erase block with the fewest valid pages, minimizing the valid data copied for that selection.",
  "note": "The candidate set matters: a global greedy policy and a policy restricted to an age window are not the same algorithm. Immediate copying cost does not by itself determine long-run behavior under skewed update frequencies.\n\nA whole-device valid-page count does not specify the selected victim's valid-page count. For four fully programmed eight-page blocks, layouts [4,4,4,4] and [0,0,8,8] both contain 16 valid pages, but global greedy selection copies four and zero pages respectively. These constructed snapshots illustrate the next selection, not steady-state behavior. [hesela-op]\n\nGlobal greedy selection need not sort every block at each collection. Desnoyers describes bins indexed by valid-page count: an invalidation moves a block reference between adjacent bins, and selection finds the lowest nonempty bin. The paper gives O(1) movement and O(pages per block) worst-case search, rather than a scan proportional to device block count. [desnoyers]",
  "related": [
    "garbage-collection",
    "over-provisioning",
    "write-amplification",
    "hot-cold-data-separation",
    "nand-page",
    "nvme-reclaim-unit-handle",
    "nvme-fdp",
    "static-wear-leveling"
  ],
  "limitations": [
    {
      "text": "Uniform-write formulas are conditional models, not universal drive predictions.",
      "citationIds": [
        "desnoyers",
        "xiang"
      ]
    }
  ],
  "citations": [
    {
      "id": "xiang",
      "title": "Xiang and Kurkoski. An Improved Analytic Expression for Write Amplification in NAND Flash. arXiv:1110.4245v1, section II.",
      "url": "https://arxiv.org/abs/1110.4245v1",
      "accessed": "2026-10-11"
    },
    {
      "id": "desnoyers",
      "title": "Peter Desnoyers. Analytic Modeling of SSD Write Performance. SYSTOR 2012, sections 2-3. DOI: 10.1145/2367589.2367603.",
      "url": "https://www.ccs.neu.edu/home/pjd/papers/pjd-systor12.pdf",
      "accessed": "2026-10-11"
    },
    {
      "id": "hesela-op",
      "title": "Hesela: SSD over-provisioning, capacity denominators and analytical-model limits",
      "url": "https://hesela.com/analyses/ssd-overprovisioning-denominators/",
      "accessed": "2026-10-11"
    }
  ],
  "status": "shipping",
  "advantages": [],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-10-18"
}
