| US 7,539,713 B2 | ||
| Allocation of likely popular objects in the train algorithm | ||
| Alexander T. Garthwaite, Beverly, Mass. (US) | ||
| Assigned to Sun Microsystems, Inc., Palo Alto, Calif. (US) | ||
| Filed on Nov. 05, 2002, as Appl. No. 10/287,930. | ||
| Prior Publication US 2004/0088338 A1, May 06, 2004 | ||
| Int. Cl. G06F 12/00 (2006.01); G06F 17/30 (2006.01) | ||
| U.S. Cl. 707—206 [707/202; 707/205] | 16 Claims |

| 1. In the method of garbage collection that treats a generation of a collected heap as divided into car sections that belong
to trains, links the car sections as to order them within the trains to which they belong, and collects the generation in
collection cycles, in each of which a collection set of at least one car section is collected in accordance with a train algorithm,
the improvement comprising:
A) designating at least one car section as a popular-object car section;
B) storing no more than one object in each said popular-object car section;
C) for at least one class, monitoring at run time a tendency of that class's instances to become popular;
D) determining whether the tendency of that class's instances to become popular meets a popular-class criterion, wherein the
tendency for a class's instances to become popular is determined from an average of instance counts over previous increments;
E) when each of at least some objects is allocated in the generation of a collected heap, performing the allocation of each
object in a popular-object car section independently of whether the object has already become popular if the object is an
instance of a class for which the tendency of the class's objects to become popular has been determined to meet the popular-class
criterion; and
F) whenever any said popular-object car section containing a popular object is collected, collecting it by re-linking that
car section without relocating the object that it contains.
|