Patent ID: 7631024

Claim:
A method for facilitating garbage collection (GC) in a memory-management system that supports both mark-sweep (MS) objects and reference-counted (RC) objects, wherein both MS objects and RC objects can be marked and have a reference count, the method comprising: during a marking phase of a GC operation in a memory-management system, identifying roots for the GC operation, marking referents of the roots, and recursively traversing referents of the roots which are MS objects and while doing so, marking referents of the traversed MS objects, wherein while recursively traversing referents of the roots which are MS objects, when a referent is identified as an RC object, the referent is marked but is not recursively traversed; and during a subsequent sweeping phase of the GC operation, reclaiming objects that are unmarked and have a zero reference count, wherein marked RC objects are not reclaimed, wherein objects which are frequently modified are classified as MS objects; and wherein objects which are infrequently modified are classified as RC objects.