Fast lifetime analysis of objects in a garbage-collected system
First Claim
1. A method for measuring the lifetime of objects in a garbage-collected system, the objects organized in a graph structure, the method including:
- maintaining a reference count for each of the objects, said reference count indicating the number of incoming pointers to each object;
updating said reference counts each time said graph structure is altered;
recording a timestamp for an object each time said reference count for said object changes;
indicating an object is dead when its reference count goes to zero;
reviewing in reverse chronological order said timestamps for each of said objects which are cyclic garbage, and for each timestamp found;
indicating that the object corresponding to said timestamp is dead;
indicating that any object reachable from said object corresponding to said timestamp is dead; and
removing any objects that have been indicated as dead from said objects which are cyclic garbage.
2 Assignments
0 Petitions
Accused Products
Abstract
The analysis of the lifetime of objects in a garbage-collected system may be accomplished quickly and effectively using reference counts and cyclic garbage analysis. A reference count is maintained for each of the objects to indicate the number of incoming pointers. Each time the graph structure is altered, the reference counts are updated. Timestamps are recorded each time the reference count for objects change. If a reference count goes to zero, the corresponding object may be indicated as dead. A garbage collection need only be run once (perhaps at the end), and after it is run the system may indicate which objects are cyclic garbage. The timestamps for objects which are cyclic garbage are then reviewed in reverse chronological order. For each timestamp found, the corresponding object and any object reachable from the corresponding object are indicated as dead. These objects are then removed from the set of cyclic garbage.
-
Citations
44 Claims
-
1. A method for measuring the lifetime of objects in a garbage-collected system, the objects organized in a graph structure, the method including:
-
maintaining a reference count for each of the objects, said reference count indicating the number of incoming pointers to each object;
updating said reference counts each time said graph structure is altered;
recording a timestamp for an object each time said reference count for said object changes;
indicating an object is dead when its reference count goes to zero;
reviewing in reverse chronological order said timestamps for each of said objects which are cyclic garbage, and for each timestamp found;
indicating that the object corresponding to said timestamp is dead;
indicating that any object reachable from said object corresponding to said timestamp is dead; and
removing any objects that have been indicated as dead from said objects which are cyclic garbage. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9)
-
-
10. A method for measuring the lifetime of objects in a garbage-collected system, the objects organized in a graph structure, the method including:
-
recording a timestamp for an object each time said reference count for said object is decremented;
executing a garbage collection, said garbage collection indicating one or more objects which are cyclic garbage;
reviewing in reverse chronological order said timestamps for each of said objects, and for each timestamp found;
if said object is cyclic garbage;
indicating that the object corresponding to said timestamp is dead;
indicating that any object reachable from said object corresponding to said timestamp is dead; and
removing any objects that have been indicated as dead from said objects which are cyclic garbage. - View Dependent Claims (11, 12, 13, 14, 15, 16, 17)
-
-
18. An apparatus for measuring the lifetime of objects in a garbage-collected system, the objects organized in a graph structure, the apparatus including:
-
a memory;
a reference count maintainer coupled to said memory;
a reference count updater coupled to said reference count maintainer;
a timestamp recorder coupled to said memory and to said reference count updater;
a dead object indicator coupled to said reference count updater and to said memory;
a garbage collector coupled to said memory; and
a reverse chronological order timestamp reviewer coupled to said garbage collector and to said memory, said reverse chronological order timestamp reviewer having a dead timestamp object indicator, a dead reachable object indicator, and a dead object cyclic garbage remover coupled to said dead timestamp object indicator and said dead reachable object indicator. - View Dependent Claims (19, 20, 21)
-
-
22. An apparatus for measuring the lifetime of objects in a garbage-collected system, the objects organized in a graph structure, the apparatus including:
-
a memory;
a timestamp recorder coupled to said memory and to said reference count updater;
a garbage collector coupled to said memory; and
a reverse chronological order timestamp reviewer coupled to said garbage collector and to said memory, said reverse chronological order timestamp reviewer having a dead timestamp object indicator, a dead reachable object indicator, and a dead object cyclic garbage remover coupled to said dead timestamp object indicator and said dead reachable object indicator. - View Dependent Claims (23, 24, 25)
-
-
26. An apparatus for measuring the lifetime of objects in a garbage-collected system, the objects organized in a graph structure, the apparatus including:
-
means for maintaining a reference count for each of the objects, said reference count indicating the number of incoming pointers to each object;
means for updating said reference counts each time said graph structure is altered;
means for recording a timestamp for an object each time said reference count for said object changes;
means for indicating an object is dead when its reference count goes to zero;
means for reviewing in reverse chronological order said timestamps for each of said objects which are cyclic garbage, and for each timestamp found;
means for indicating that the object corresponding to said timestamp is dead;
means for indicating that any object reachable from said object corresponding to said timestamp is dead; and
means for removing any objects that have been indicated as dead from said objects which are cyclic garbage. - View Dependent Claims (27, 28, 29, 30, 31, 32, 33, 34)
-
-
35. An apparatus for measuring the lifetime of objects in a garbage-collected system, the objects organized in a graph structure, the apparatus including:
-
means for recording a timestamp for an object each time said reference count for said object is decremented;
means for executing a garbage collection, said garbage collection indicating one or more objects which are cyclic garbage;
means for reviewing in reverse chronological order said timestamps for each of said objects, and for each timestamp found;
if said object is cyclic garbage;
means for indicating that the object corresponding to said timestamp is dead;
means for indicating that any object reachable from said object corresponding to said timestamp is dead; and
means for removing any objects that have been indicated as dead from said objects which are cyclic garbage. - View Dependent Claims (36, 37, 38, 39, 40, 41, 42)
-
-
43. A program storage device readable by a machine, tangibly embodying a program of instructions executable by the machine to perform a method for measuring the lifetime of objects in a garbage-collected system, the objects organized in a graph structure, the method including:
-
maintaining a reference count for each of the objects, said reference count indicating the number of incoming pointers to each object;
updating said reference counts each time said graph structure is altered;
recording a timestamp for an object each time said reference count for said object changes;
indicating an object is dead when its reference count goes to zero;
reviewing in reverse chronological order said timestamps for each of said objects which are cyclic garbage, and for each timestamp found;
indicating that the object corresponding to said timestamp is dead;
indicating that any object reachable from said object corresponding to said timestamp is dead; and
removing any objects that have been indicated as dead from said objects which are cyclic garbage.
-
-
44. A program storage device readable by a machine, tangibly embodying a program of instructions executable by the machine to perform a method for measuring the lifetime of objects in a garbage-collected system, the objects organized in a graph structure, the method including:
-
recording a timestamp for an object each time said reference count for said object is decremented;
executing a garbage collection, said garbage collection indicating one or more objects which are cyclic garbage;
reviewing in reverse chronological order said timestamps for each of said objects, and for each timestamp found;
if said object is cyclic garbage;
indicating that the object corresponding to said timestamp is dead;
indicating that any object reachable from said object corresponding to said timestamp is dead; and
removing any objects that have been indicated as dead from said objects which are cyclic garbage.
-
Specification