Patent ID: 7315873

Claim:
A method for determining if an object in a memory resource in a computer system is a candidate for garbage collection, comprising: for each of a plurality of objects in the memory resource, maintaining a reference count based on a number of objects pointing thereto, and maintaining a depth value based on a distance from a global data object in a reference chain, the step of maintaining a depth value further including at least keeping an existing depth value associated with an object when a new link is added from another object to the object if the existing depth value associated with the object is a valid depth value and if the existing depth value associated with the object is an uninitialized value, changing the existing depth value associated with the object to one more than a depth value associated with said another object; and identifying, based on the associated reference count and depth value, which of the plurality of objects are processed to determine whether or not they are garbage; wherein each of the plurality of objects can be pointed to by one or more other objects and wherein each of the plurality of objects can be part of, and have different positions in, different reference chains such that the reference count and depth value change as the other objects that point to each of the plurality of objects change.