Patent ID: 7620943

Claim:
A computer system comprising: a processor; a memory operatively connected to the processor; and a garbage collector stored in memory and configured to: identify a plurality of objects marked as garbage in a memory heap of the computer system; identify a first object of a first object class, a second object of a second object class, and a third object of a third object class from the plurality of objects, wherein the first object comprises a first reference to the second object, wherein the second object comprises a second reference to the third object, and wherein the third object comprises a lack of references to the plurality of objects; assign the first object class to a first class group based on the first reference, the second object class to a second class group based on the second reference, and the third object class to a third class group based on the lack of references; reserve a first car section of a garbage collection train (GCT) solely for instances of members of the first class group, a second car section of the GCT solely for instances of members of the second class group, and a third car section of the GCT solely for instances of members of the third class group; insert the first object into the first car section, insert the second object in the second car section, and insert the third object into the third car section; and reclaim a portion of the memory heap for reuse by collecting the first car section.