IP Library Granted Patent US 7,519,640
Granted Patent B1
US 7,519,640 · App. 10/881,100 · Granted Apr 14, 2009

Better placement of dying objects in a generation managed by the train algorithm

View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 7,519,640
App. No.
10/881,100
Granted
Apr 14, 2009
Kind
B1
Abstract

In a garbage collector that employs the train algorithm, some objects in the collection set are evacuated from the collection set, even though they are referred to only by weak references, in order to keep the data that they contain available for post-mortem processing. The destinations to which at least some such objects are evacuated are chosen independently of where the weak references to them are located.

Claims (32)

1. A computer system including memory, a mutator and a garbage collector, wherein the garbage collector treats a generation of a heap in the memory as divided into a plurality of car sections grouped into a plurality of trains each ordered in a collection order and configured to collect in collection increments respective collection sets of those car sections in accordance with a train algorithm, wherein the computer system is configured to implement a method wherein, in a collection increment of the collection increments:

the garbage collector evacuates a first object from a respective collection set in response to the existence of a weak reference associated with the first object,

wherein an object associated solely with a weak reference is evacuated from the respective collection set, prior to reclamation of the respective collection set, based upon a determination that a predetermined amount of unused space is remaining in the heap, and

wherein the weak reference is denoted by placement of the weak reference in a second object defined by the mutator as belonging to a predetermined class associated with weak references;

the garbage collector selects one of the plurality of trains into which the first object is evacuated from the respective collection set in response to determining the existence of a reference to the object located in the generation,

wherein the one of the plurality of trains is selected independently of the reference's location when the reference corresponds solely to a weak reference; and

the garbage collector thereafter reclaims the respective collection set as allocatable memory.

2. The computer system of claim 1 , wherein when the first object is evacuated from the respective collection set in response to the existence of the weak reference, the first object is placed in one of the plurality of car sections, wherein the one of the plurality of car sections belongs to a dying-object train, which contains only objects thus evacuated and their followers.

3. The computer system of claim 2 , wherein the dying-object train's position in the collection order is immediately behind a last train that comprises any objects associated with the respective collection set.

4. The computer system of claim 1 , wherein the location to which the first object is evacuated from the respective collection set in response to the existence of the weak reference is independent of the reference's location if the first object has not previously been evacuated in response to the existence of the weak reference prior to the at least one of the collection increments.

5. The computer system of claim 1 , wherein one of the plurality of trains to which the first object is evacuated from the respective collection set in response to the weak reference is dependent on the reference's location if the first object has previously been evacuated in response to the existence of the weak reference prior to the at least one of the collection increments more than a predetermined number of times.

6. A storage medium containing instructions readable by a computer system including memory to configure the computer system to implement a mutator and a garbage collector wherein the garbage collector treats a generation of a heap in the memory as divided into a plurality of car sections grouped into a plurality of trains each ordered in a collection order and configured to collect in collection increments respective collection sets of those car sections in accordance with a train algorithm, wherein, a collection increment of the collection increments:

the garbage collector evacuates a first object from a respective collection set in response to the existence of a weak reference associated with the first object,

wherein an object associated solely with a weak reference is evacuated from the respective collection set, prior to reclamation of the respective collection set, based upon a determination that a predetermined amount of unused space is remaining in the heap, and

wherein the weak reference is denoted by placement of the weak reference in a second object defined by the mutator as belonging to a predetermined class associated with weak references;

the garbage collector selects one of the plurality of trains into which the first object is evacuated from the respective collection set in response to determining the existence of a reference to the object located in the generation,

wherein the one of the plurality of trains is selected independently of the reference's location when the reference corresponds solely to a weak reference; and

the garbage collector thereafter reclaims the respective collection set as allocatable.

7. The storage medium of claim 6 , wherein when the first object is evacuated from the respective collection set in response to the existence of the weak reference, the first object is placed in one of the plurality of car sections, wherein the one of the plurality of car sections belongs to a dying-object train, which contains only objects thus evacuated and their followers.

8. The storage medium as defined in claim 7 , wherein the dying-object train's position in the collection order is immediately behind a last train that comprises any objects associated with the respective collection set.

9. The storage medium as defined in claim 6 , wherein the location to which the first object is evacuated from the respective collection set in response to the existence of the weak reference is independent of the reference's location if the first object has not previously been evacuated in response to the existence of the weak reference prior to the at least one of the collection increments.

10. The storage medium as defined in claim 6 , wherein the one of the plurality of trains to which the first object is evacuated from the respective collection set in response to the weak reference is dependent on the reference's location if the first object has previously been evacuated in response to the existence of the weak reference prior to the at least one of the collection increments more than a predetermined number of times.

11. A computer system comprising:

a hardware processor;

first means for treating a generation of a heap in a memory, wherein the memory is divided into a plurality of car sections and grouped into a plurality of trains ordered in a collection order; and

second means for collecting in collection increments respective collection sets of those car sections in accordance with a train algorithm by:

evacuating a first object from a respective collection set in response to the existence of a weak reference associated with the first object, wherein an object associated solely with a weak reference is evacuated from the respective collection set, prior to reclamation of the respective collection set, based upon a determination that a predetermined amount of unused space is remaining in the heap, wherein the weak reference is denoted by placement of the weak reference in a second object defined by a mutator as belonging to a predetermined class associated with weak references;

selecting one of the plurality of trains into which the first object is evacuated from the respective collection set in response to determining the existence of a reference to the object located in the generation, wherein the one of the plurality of trains is selected independently of the reference's location when the reference corresponds solely to a weak reference; and

thereafter reclaiming the collection set as allocatable memory,

wherein the mutator performs an application program function using the allocatable memory,

wherein the mutator is separate from the garbage collector in the computer system, and

wherein a portion of the first means and the second means executes on the hardware processor.

Assignments (2)
MERGER AND CHANGE OF NAME Recorded Dec 16, 2015
From: ORACLE USA, INC.; SUN MICROSYSTEMS, INC.; ORACLE AMERICA, INC.
To: ORACLE AMERICA, INC.
Reel/Frame 037304/0151 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jun 30, 2004
From: GARTHWAITE, ALEXANDER T.
To: SUN MICROSYSTEMS, INC.
Reel/Frame 015538/0492 →