Method and apparatus for performing generational garbage collection using middle-aged objects
First Claim
1. In a computer system comprising a heap that stores a plurality of objects that are logically partitioned into at least a set of old objects that have each survived at least a predetermined number N of reclamation operations, a set of middle-aged objects that have each survived at least a predetermined number M of reclamation operations, wherein M is less than N, and a third set of objects distinct from said old and middle-aged sets of objects, and wherein the computer system performs a plurality of reclamation operations that use a remembered set to reclaim space in the heap, a method for maintaining the remembered set comprising the steps of:
- providing said remembered set from a previous reclamation operation;
identifying said old or middle-aged objects that include an object reference that has been modified since the last reclamation operation; and
creating an entry in a remembered set for a next reclamation period for a middle-aged object that is live and (i) identified in said remembered set from a previous reclamation operation or (ii) identified as having an object reference that has been modified since the last reclamation operation.
1 Assignment
0 Petitions
Accused Products
Abstract
A method and apparatus are provided for the efficient management of remembered sets in a generational garbage collection scheme. The present invention detects when an old object has a pointer to a young object, and needs to be added to the remembered set. A write buffer and a temporary buffer are used to create and maintain the remembered set. Entries in the write and temporary buffers are used as part of the root set for creating the remembered set for the next garbage collection. A barrier bit associated with each object differentiates generations in the generational garbage collection scheme and is used to determine whether to make an entry into a write buffer when a reference to another object is stored into an object. Objects that have survived one or more collections, but not the minimum number, N, of collections to be considered an old object are referred to as “middle-aged” objects. During a minor garbage collection, the write buffer is scanned. Objects identified in the write buffer are transferred to the remembered set for the next cycle if the object is (i) an old object pointing to a younger object, or (ii) a middle-aged object that is determined to be live. Middle-aged objects identified in the write buffer that are not yet known to be live are transferred to the temporary buffer. At the end of the minor collection, the temporary buffer is processed and objects that are then known to be live are transferred into the remembered set.
-
Citations
35 Claims
-
1. In a computer system comprising a heap that stores a plurality of objects that are logically partitioned into at least a set of old objects that have each survived at least a predetermined number N of reclamation operations, a set of middle-aged objects that have each survived at least a predetermined number M of reclamation operations, wherein M is less than N, and a third set of objects distinct from said old and middle-aged sets of objects, and wherein the computer system performs a plurality of reclamation operations that use a remembered set to reclaim space in the heap, a method for maintaining the remembered set comprising the steps of:
-
providing said remembered set from a previous reclamation operation;
identifying said old or middle-aged objects that include an object reference that has been modified since the last reclamation operation; and
creating an entry in a remembered set for a next reclamation period for a middle-aged object that is live and (i) identified in said remembered set from a previous reclamation operation or (ii) identified as having an object reference that has been modified since the last reclamation operation. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9)
-
-
10. In a computer system comprising a heap that stores a plurality of objects that are logically partitioned into at least a set of old objects that have each survived at least a predetermined number N of reclamation operations, a set of middle-aged objects that have each survived at least a predetermined number M of reclamation operations, wherein M is less than N, and a third set of objects distinct from said old and middle-aged sets of objects, and wherein the computer system performs a plurality of reclamation operations that use a remembered set to reclaim space in the heap, a method for maintaining the remembered set comprising the steps of:
-
providing said remembered set from a previous reclamation operation;
identifying said old or middle-aged objects that include an object reference that has been modified since the last reclamation operation; and
creating an entry in a remembered set for a next reclamation period for an old object that is (i) identified in said remembered set from a previous reclamation operation, or (ii) identified as having an object reference that has been modified since the last reclamation operation. - View Dependent Claims (11, 12, 13, 14, 15, 16, 17, 18, 29)
-
-
19. In a computer system comprising a heap that stores a plurality of objects that are logically partitioned into at least a set of old objects that have each survived at least a predetermined number N of reclamation operations, a set of middle-aged objects that have each survived at least a predetermined number M of reclamation operations, wherein M is less than N, and a third set of objects distinct from said old and middle-aged sets of objects, and wherein the computer system performs a plurality of reclamation operations that use a remembered set to reclaim space in the heap, a method for maintaining the remembered set comprising the steps of:
-
providing said remembered set from a previous reclamation operation;
identifying said old or middle-aged objects that include an object reference that has been modified since the last reclamation operation; and
creating an entry in a table of entries during one of said reclamation operations for a middle-aged object that is not known to be live and is (i) identified in said remembered set from a previous reclamation operation, or (ii) identified as having an object reference that has been modified since the last reclamation operation. - View Dependent Claims (20, 21, 22, 23, 24, 25, 26, 27, 28)
-
-
30. A generational garbage collection manager for a remembered set in a system that stores a plurality of objects that are logically partitioned into at least a set of old objects that have each survived at least a predetermined number N of reclamation operations, a set of middle-aged objects that have each survived at least a predetermined number M of reclamation operations, wherein M is less than N, and a third set of objects distinct from said old and middle-aged sets of objects, and wherein the computer system performs a plurality of reclamation operations that use a remembered set to reclaim space in the heap, said generational garbage collection manager comprising:
-
a memory that stores computer-readable code; and
a processor operatively coupled to said memory, said processor configured to implement said computer-readable code, said computer-readable code configured to;
provide said remembered set from a previous reclamation operation;
identify said old or middle-aged objects that include an object reference that has been modified since the last reclamation operation; and
create an entry in a remembered set for a next reclamation period for a middle-aged object that is live and (i) identified in said remembered set from a previous reclamation operation or (ii) identified as having an object reference that has been modified since the last reclamation operation.
-
-
31. A generational garbage collection manager for a remembered set in a system that stores a plurality of objects that are logically partitioned into at least a set of old objects that have each survived at least a predetermined number N of reclamation operations, a set of middle-aged objects that have each survived at least a predetermined number M of reclamation operations, wherein M is less than N, and a third set of objects distinct from said old and middle-aged sets of objects, and wherein the computer system performs a plurality of reclamation operations that use a remembered set to reclaim space in the heap, said generational garbage collection manager comprising:
-
a memory that stores computer-readable code; and
a processor operatively coupled to said memory, said processor configured to implement said computer-readable code, said computer-readable code configured to;
provide said remembered set from a previous reclamation operation;
identify said old or middle-aged objects that include an object reference that has been modified since the last reclamation operation; and
create an entry in a remembered set for a next reclamation period for an old object that is (i) identified in said remembered set from a previous reclamation operation, or (ii) identified as having an object reference that has been modified since the last reclamation operation.
-
-
32. A generational garbage collection manager for a remembered set in a system that stores a plurality of objects that are logically partitioned into at least a set of old objects that have each survived at least a predetermined number N of reclamation operations, a set of middle-aged objects that have each survived at least a predetermined number M of reclamation operations, wherein M is less than N, and a third set of objects distinct from said old and middle-aged sets of objects, and wherein the computer system performs a plurality of reclamation operations that use a remembered set to reclaim space in the heap, said generational garbage collection manager comprising:
-
a memory that stores computer-readable code; and
a processor operatively coupled to said memory, said processor configured to implement said computer-readable code, said computer-readable code configured to;
provide said remembered set from a previous reclamation operation;
identify said old or middle-aged objects that include an object reference that has been modified since the last reclamation operation; and
create an entry in a table of entries during one of said reclamation operations for a middle-aged object that is not known to be live and is (i) identified in said remembered set from a previous reclamation operation, or (ii) identified as having an object reference that has been modified since the last reclamation operation.
-
-
33. A program storage device readable by a machine, tangibly embodying a program of instructions executable by the machine to perform method steps for managing a generational garbage collection system for a remembered set in a system that stores a plurality of objects that are logically partitioned into at least a set of old objects that have each survived at least a predetermined number N of reclamation operations, a set of middle-aged objects that have each survived at least a predetermined number M of reclamation operations, wherein M is less than N, and a third set of objects distinct from said old and middle-aged sets of objects, and wherein the computer system performs a plurality of reclamation operations that use a remembered set to reclaim space in the heap, said method steps comprising:
-
providing said remembered set from a previous reclamation operation;
identifying said old or middle-aged objects that include an object reference that has been modified since the last reclamation operation; and
creating an entry in a remembered set for a next reclamation period for a middle-aged object that is live and (i) identified in said remembered set from a previous reclamation operation or (ii) identified as having an object reference that has been modified since the last reclamation operation.
-
-
34. A program storage device readable by a machine, tangibly embodying a program of instructions executable by the machine to perform method steps for managing a generational garbage collection system for a remembered set in a system that stores a plurality of objects that are logically partitioned into at least a set of old objects that have each survived at least a predetermined number N of reclamation operations, a set of middle-aged objects that have each survived at least a predetermined number M of reclamation operations, wherein M is less than N, and a third set of objects distinct from said old and middle-aged sets of objects, and wherein the computer system performs a plurality of reclamation operations that use a remembered set to reclaim space in the heap, said method steps comprising:
-
providing said remembered set from a previous reclamation operation;
identifying said old or middle-aged objects that include an object reference that has been modified since the last reclamation operation; and
creating an entry in a remembered set for a next reclamation period for an old object that is (i) identified in said remembered set from a previous reclamation operation, or (ii) identified as having an object reference that has been modified since the last reclamation operation.
-
-
35. A program storage device readable by a machine, tangibly embodying a program of instructions executable by the machine to perform method steps for managing a generational garbage collection system for a remembered set in a system that stores a plurality of objects that are logically partitioned into at least a set of old objects that have each survived at least a predetermined number N of reclamation operations, a set of middle-aged objects that have each survived at least a predetermined number M of reclamation operations, wherein M is less than N, and a third set of objects distinct from said old and middle-aged sets of objects, and wherein the computer system performs a plurality of reclamation operations that use a remembered set to reclaim space in the heap, said method steps comprising:
-
providing said remembered set from a previous reclamation operation;
identifying said old or middle-aged objects that include an object reference that has been modified since the last reclamation operation; and
creating an entry in a table of entries during one of said reclamation operations for a middle-aged object that is not known to be live and is (i) identified in said remembered set from a previous reclamation operation, or (ii) identified as having an object reference that has been modified since the last reclamation operation.
-
Specification