Reference articles on history, science, culture and more
Encyclopedia

Distributed garbage collection

Distributed garbage collection (DGC) in computing is a particular case of garbage collection where a remote client can hold references to an object.

DGC uses some combination of the classical garbage collection (GC) techniques, tracing and reference counting. It has to cooperate with local garbage collectors in each process in order to keep global counts, or to globally trace accessibility of data. In general, remote processors do not have to know about internal counting or tracing in a given process, and the relevant information is stored in interfaces associated with each process.

DGC is complex and can be costly and slow in freeing memory. As a cheap way of avoiding DGC algorithms, one can rely on a time lease, set or configured on the remote object; it is the stub's task to periodically renew the lease on the remote object. If the lease has expired, the server process (the process owning the remote object) can safely assume that either the client is no longer interested in the object, or that a network partition or crash obstructed lease renewal, in which case it is "hard luck" for the client if it is in fact still interested. Hence, if there is only a single reference to the remote object on the server representing a remote reference from that client, that reference can be dropped, which will mean that the local garbage collector on the server will garbage-collect the object at some future point in time.

Watch videos about Distributed garbage collectionExplainers and documentaries on YouTube (opens in a new tab)

Sources and credits

This article is adapted from the Wikipedia article Distributed garbage collection, written by its contributors and licensed under CC BY-SA 4.0. Fathomly has changed the layout, removed citation markers, navigation and maintenance notices, and adjusted punctuation. This adapted version is shared under the same license. For references, see the original article.

Fathomly is not affiliated with or endorsed by the Wikimedia Foundation. Spotted a problem? Tell us.