Using class properties to segregate objects in a generation managed by the train algorithm
First Claim
1. 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.
2 Assignments
0 Petitions
Accused Products
Abstract
A garbage collector that employs the train algorithm divides object classes into a number of class groups, which are considered to have different ranks. The class group having the lowest rank, for example, may include only classes whose instances contain no references. The group of the next-higher rank may consist of classes whose instances include references only to objects that are instances of final classes whose instances include no references. The highest-rank group may include all other classes. Car sections are associated with the class groups and contain only instances of classes belonging to the class groups with which they are associated. Within each train, each car associated with a class group of a higher-rank is placed earlier in the collection order than is a car associated with a lower-rank class group.
-
Citations
36 Claims
-
1. 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. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)
-
-
13. A machine readable medium storing instructions to perform garbage collection, the instructions comprising functionality to:
-
identify a plurality of objects marked as garbage in a memory heap in a 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. - View Dependent Claims (14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24)
-
-
25. A method of garbage collection comprising:
-
identifying a plurality of objects marked as garbage in a memory heap of a computer system; identifying 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; assigning 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; reserving 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; inserting the first object into the first car section, inserting the second object in the second car section, and inserting the third object into the third car section; and reclaiming a portion of the memory heap for reuse by collecting the first car section. - View Dependent Claims (26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36)
-
Specification