Reclaim resources that nothing currently reaches. From a set of declared roots, anything reachable by following the reference relation is live; anything else is unreachable and may be reclaimed without changing observable behaviour. The discriminator is reachability, not idleness: collectible means "can never be reached again," not "unused right now."
Imagine your toys are only worth keeping if there's still a string tying them to you. If a toy has no string reaching it anymore, nobody can ever play with it again, so it's okay to put it away and free up space. A helper goes around following all the strings, keeps everything that's still tied to you, and clears away the rest.
Clean Up What's Unreachable
Garbage collection is about cleaning up resources, like computer memory, that nothing can reach anymore. The system starts from a few special starting points called roots, and anything you can get to by following links from a root is still 'live' and must be kept. Anything you can't reach from any root is safe to clean up, because no future step could ever use it again. The cleanup works in a simple repeating shape: list the roots, follow all the links to mark what's reachable, then sweep away whatever wasn't marked. The clever part is the rule for what's garbage: it's not whether something is being used right now, but whether it could ever be reached again.
Reachability-Bounded Reclaiming
Garbage collection is the pattern of reclaiming resources that nothing currently reaches. A system holds a stock of resources (memory cells, records, accounts) and a set of roots from which legitimate access begins. Anything reachable from a root by following the system's reference relation is live; anything else is unreachable and can be reclaimed without changing observable behaviour. It is structural in three places at once: reachability is defined by the topology of references, not anyone's intent; reclamation returns the resource to the free pool without consulting its now-orphaned owner; and safety depends only on computing the closure correctly, because once a resource is provably unreachable, no future computation can depend on it. The work decomposes into a repeatable shape: declare the roots, walk the reference graph, mark what is reached, sweep what is not. The key commitment is the reachability discriminator: collectibility is decided not by whether a resource is currently idle, but by whether it can ever be reached again from a declared root, which is a stronger and different test.
Garbage collection is the structural pattern of reclaiming resources that nothing currently reaches. A system holds a stock of resources (memory cells, records, obligations, artifacts, accounts) and a set of roots from which legitimate access begins. Anything reachable from a root by following the system's reference relation is live; anything else is unreachable and may be reclaimed without changing observable behaviour. The pattern is structural in three places at once: reachability is defined by the topology of references, not by anyone's intent; reclamation restores the resource to the free pool without consulting the now-orphaned owner; and safety depends only on the closure being correctly computed, because once a resource is provably unreachable, it can be reclaimed precisely because no future computation can depend on it. The pattern decomposes the work into a small, repeatable shape that recurs across substrates: declare the roots, walk the reference graph from those roots, mark what is reached, sweep what is not. The same skeleton supports refinements (generational hypotheses, incremental collection, concurrent sweep, region-based reclamation), but those are tunings of one underlying motion. The prime is not 'memory cleanup'; it is reachability-bounded reclamation, and it is what makes large systems sustainable in any substrate where resources are scarce and references are mutable. The substrate-neutral commitment is the reachability discriminator: collectibility is determined not by whether a resource is currently idle but by whether it can ever be reached again from a declared root.
Turns "should we keep this?" from a judgment call into a graph-theoretic question relative to a declared root set, and makes the root set the focus of governance — almost every cleanup dispute is really a dispute about what counts as a root.
Collapses an unbounded, distributed bookkeeping problem into a single periodic computation over a graph, with only two well-understood failure modes: a mis-declared root set and a closure computed over stale data.
Provides a portable kit: identify roots first, treat reachability as a transitive fixed-point, choose between tracing (collects cycles, pauses) and reference counting (incremental, misses cycles), and state liveness invariants once and reuse them.
CS → organisations: the move from "ask every owner" (reference counting) to "ask the dependency graph from declared surfaces" (tracing) recurs in deprecation.
CS → law: the write barrier idea explains why ledgers need transactional notification of every ownership change for escheat to work.
CS → records management: retention-schedule mandated destruction maps cleanly onto data-retention regimes with isomorphic failure modes.
A platform team facing 412 microservices, 70 believed obsolete, declares the roots (every public API, paying feature, regulatory commitment), walks the call graph, and the unmarked services are the candidate set — replacing "we don't think anyone uses it" with "no root reaches X."
Garbage Collection is not Caching because caching retains items on a value heuristic (recency, frequency) and eviction is a performance bet, whereas garbage collection reclaims on a hard reachability predicate and freeing a reachable item is a correctness bug.
Garbage Collection is not Sequestration because sequestration isolates and retains a resource, whereas garbage collection releases an unreachable resource back to the free pool.
Garbage Collection is not Maintenance because maintenance preserves the live portion against decay, whereas garbage collection removes the dead portion that nothing reaches.