Automatic reclamation of allocated storage no longer reachable by a program. Clearing a private linked structure can discard its root references in constant pointer work even though later reclamation may require additional collector work. Data-structure operation bounds should state whether they count deferred memory-management costs.
A tracing garbage collection implementation starts from garbage collection roots and follows software object references. Software objects outside that reachable set can be reclaimed, including cycles that have no path from a root. A decorator or adapter holding a component reference keeps that component reachable while the wrapper remains reachable. The number of allocated software objects alone does not establish how much storage can be reclaimed.
A garbage collection root is an initially accessible reference from which the collector traces reachable software objects. Depending on the runtime, roots include active stack or register references and static references. Software objects reached transitively through reference fields must remain live. Exact root sets and collection timing are implementation details.
Articles by others on the same topic
There are currently no matching articles.