Ernestas Poškus

Technical blog

"We must view with profound respect the infinite capacity of the human mind to resist the introduction of useful knowledge." - Thomas R. Lounsbury

| github | goodreads | linkedin | twitter |

ansible 2 / elasticsearch 2 / kernel 2 / linux 2 / mnemonics 1 / nginx 1 / paper 32 / personal 5 / rust 1 / tools 2 /

On the fly garbage collection

WC 252 / RT 2min


In our abstract form of the problem, we consider a directed graph of varying structure but with a fixed number of nodes, in which each node has at most two outgoing edges. More precisely, each node may have a left-hand outgoing edge and may have a right-hand outgoing edge, but either of them or both may be missing. In this graph a fixed set of nodes exists, called “the roots.” A node is called “reachable” if it is reachable from at least one root via a directed path along the edges.

The subgraph consists of all reachable nodes and their interconnections is called ‘the data structure’; nonreachable nodes that do not belong to the data structure are called garbage.

Data structure can modified:

Mutator: redirect an outgoing edge of reachable node towards an already reachable one.

Collector:

Notes

Free list - collection of nodes that have been identified as garbage.