Method and apparatus for performing generational garbage collection using barrier bits
First Claim
1. In a computer system comprising a heap that stores a plurality of objects that are logically partitioned into at least a first set of objects and a second set of objects distinct from said first set of objects, wherein the computer system further includes a remembered set and wherein the computer system performs a plurality of reclamation operations that use the remembered set to reclaim space in the heap, a method for maintaining the remembered set comprising the steps of:
- storing the remembered set from the last reclamation operation;
storing a table of entries between each reclamation operation, wherein each entry identifies a given object that belongs to said first set of objects and includes an object reference that has been modified since the last reclamation operation;
selecting from the table at least one entry corresponding to an object, O; and
updating the remembered set to identify the object, O, corresponding to the selected at least one entry, and storing the updated remembered set for the next reclamation operation.
1 Assignment
0 Petitions
Accused Products
Abstract
A method and apparatus are disclosed for efficiently creating and maintaining a remembered set in a generational garbage collection scheme using a write buffer and a barrier bit associated with each object. A barrier bit associated with each object differentiates generations in a generational garbage collection scheme. When an object is first created, the barrier bit of the object is set to zero. The barrier bit is set when the object becomes old, for example, after surviving a first garbage collection. The barrier bit is used to determine whether to make an entry into a write buffer when a reference to another object is stored into an object. An entry is made in the write buffer only if the barrier bit of the object that is written into is set. At the end of each garbage collection, entries in the write buffer are added to the remembered set for the next garbage collection if the objects satisfy the criterion for membership, i.e., they are live and may contain pointers to objects in a younger generation. Thus, the remembered set consists of objects that were in the write buffer at the time of a garbage collection, that must be remembered for the next garbage collection. The write buffer is kept small by eliminating duplicate entries. The present invention turns off the barrier bit after the first store during each reclamation period (which causes the object to be identified in the write buffer). The barrier bit is turned on again by the garbage collector after the write buffer has been processed.
56 Citations
38 Claims
-
1. In a computer system comprising a heap that stores a plurality of objects that are logically partitioned into at least a first set of objects and a second set of objects distinct from said first set of objects, wherein the computer system further includes a remembered set and wherein the computer system performs a plurality of reclamation operations that use the remembered set to reclaim space in the heap, a method for maintaining the remembered set comprising the steps of:
-
storing the remembered set from the last reclamation operation;
storing a table of entries between each reclamation operation, wherein each entry identifies a given object that belongs to said first set of objects and includes an object reference that has been modified since the last reclamation operation;
selecting from the table at least one entry corresponding to an object, O; and
updating the remembered set to identify the object, O, corresponding to the selected at least one entry, and storing the updated remembered set for the next reclamation operation. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A method for managing a remembered set in a generational garbage collection system that stores a plurality of objects that arc logically partitioned into at least a first set of objects and a second set of objects distinct from said first set of objects, said method comprising the steps of:
-
setting a barrier bit associated with a given object when said object is promoted to said first set; and
storing said given object in a table of entries if said barrier bit is set and an object reference is stored in said given object, wherein said table of entries is a data structure distinct from said remembered set. - View Dependent Claims (9, 10, 11, 12, 13)
-
-
14. A method for managing a remembered set in a generational garbage collection system that stores a plurality of objects that are logically partitioned into at least a first set of objects and a second set of objects distinct from said first set of objects, said method comprising the steps of:
-
storing said remembered set from the last reclamation operation;
storing a given object in a table of entries between each reclamation operation if a barrier bit associated with said object indicates that said given object is in said first set and an object reference is stored in said given object;
identifying objects to be processed for said reclamation operation using said table; and
updating the remembered set for the next reclamation operation with entries from said table. - View Dependent Claims (15, 16, 17, 18)
-
-
19. 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 first set of objects and a second set of objects distinct from said first set of objects, 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;
store the remembered set from the last reclamation operation;
store a table of entries between each reclamation operation, wherein each entry identifies a given object that belongs to said first set of objects and includes an object reference that has been modified since the last reclamation operation;
select from the table at least one entry corresponding to an object, O; and
update the remembered set to identify the object, O, corresponding to the selected at least one entry, and storing the updated remembered set for the next reclamation operation. - View Dependent Claims (20, 21, 22, 23, 24, 25)
-
-
26. 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 first set of objects and a second set of objects distinct from said first set of objects, 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;
set a barrier bit associated with a given object when said object is promoted to said first set; and
store said given object in a table of entries if said barrier bit is set and an object reference is stored in said given object, wherein said table of entries is a data structure distinct from said remembered set. - View Dependent Claims (27, 28, 29, 30)
-
-
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 first set of objects and a second set of objects distinct from said first set of objects, 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;
store a given object in a table of entries between each reclamation operation if a barrier bit associated with said object indicates that said given object is in said first set and an object reference is stored in said given object;
identify objects to be processed for said reclamation operation using said table; and
update the remembered set for the next reclamation operation with entries from said table. - View Dependent Claims (32, 33, 34, 35)
-
-
36. 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 first set of objects and a second set of objects distinct from said first set of objects, said method steps comprising:
-
storing the remembered set from the last reclamation operation;
storing a table of entries between each reclamation operation, wherein each entry identifies a given object that belongs to said first set of objects and includes an object reference that has been modified since the last reclamation operation;
selecting from the table at least one entry corresponding to an object, O; and
updating the remembered set to identify the object, O, corresponding to the selected at least one entry, and storing the updated remembered set for the next reclamation operation.
-
-
37. 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 first set of objects and a second set of objects distinct from said first set of objects, said method steps comprising:
-
setting a barrier bit associated with a given object when said object is promoted to said first set; and
storing said given object in a table of entries if said barrier bit is set and an object reference is stored in said given object, wherein said table of entries is a data structure distinct from said remembered set.
-
-
38. 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 gargage collection system for a remembered set in a system that stores a plurality of objects that are logically partitioned into at least a first set of objects and a second seet of objects distinct from said first set of objects, said method steps comprising:
-
setting a barrier bit associated with a given object when said object is promoted to said first set; and
storing said given object in a table of entries if said barrrier bit is set and an object reference is stored in said given object, wherein said table of entries is a data structure distinct from said remembered set.
-
Specification