Embodiments of the present invention relate to garbage collection and, more specifically, to probabilistic, parallel collection of memory no longer in use.
Memory management ensures that a computer's memory is being used effectively, and memory management systems generally include garbage collection. Garbage collection is a process of reclaiming memory no longer in use by an application, thereby freeing up that memory for reuse. In some garbage collection, an object is considered to be no longer in use if it is unreachable, and an object is generally considered reachable if it is referenced, either directly or indirectly, by at least one object in use by the application.
A commonly used mechanism of garbage collection is mark-sweep, which includes a marking phase followed by a sweeping phase. During the marking phase, a crawler performs a tree traversal from each element of a root set of the program, and marks each object reached during that traversal. Marking introduces collection pauses, also known as Stop the World (STW) phases, in which the user application is suspended. During the sweeping phase, the memory is scanned for marks, and unmarked objects are reclaimed as garbage.