Methods and apparatus for generational dynamic management of computer memory
First Claim
1. A computer-implemented method for dynamically managing memory associated with a computer system, the memory including a first memory section and a second memory section that is divided into a plurality of blocks, the blocks in the second memory section each having an associated marker, the method comprising:
- performing a first garbage collection on the first memory section;
performing a second garbage collection on a selected one of the blocks in the second memory section;
performing a third garbage collection on the selected block in the second memory section, wherein the third garbage collection includes determining whether the selected block includes a first object which references a second object which is not included in the selected block based at least in part on a status indicated by the marker associated with the selected block, wherein the status includes an indication of whether the reference to the second object was stored after the second garbage collection was performed; and
when the reference to the second object was stored after the second garbage collection was performed, creating a new root array using the selected marker.
1 Assignment
0 Petitions
Accused Products
Abstract
The present invention relates to methods and apparatus for performing generational garbage collection within computer memory. According to one aspect of the present invention, a computer-implemented method for dynamically managing memory which includes a first memory section and a second memory section that is divided into a plurality of blocks each having an associated marker, includes performing a first garbage collection on the first memory section. The method also includes performing a second garbage collection on a selected one of the blocks in the second memory section. A third garbage collection is performed on the selected block in the second memory section. The third garbage collection includes determining whether the selected block includes a first object which references a second object which is not included in the selected block based at least in part on a status indicated by the marker associated with the selected block. The status includes an indication of whether the reference to the second object was stored after the second garbage collection was performed, and if the reference to the second object was stored after the second garbage collection was performed, a new root array is created using the selected marker.
-
Citations
49 Claims
-
1. A computer-implemented method for dynamically managing memory associated with a computer system, the memory including a first memory section and a second memory section that is divided into a plurality of blocks, the blocks in the second memory section each having an associated marker, the method comprising:
-
performing a first garbage collection on the first memory section;
performing a second garbage collection on a selected one of the blocks in the second memory section;
performing a third garbage collection on the selected block in the second memory section, wherein the third garbage collection includes determining whether the selected block includes a first object which references a second object which is not included in the selected block based at least in part on a status indicated by the marker associated with the selected block, wherein the status includes an indication of whether the reference to the second object was stored after the second garbage collection was performed; and
when the reference to the second object was stored after the second garbage collection was performed, creating a new root array using the selected marker. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9)
determining whether the second object is in the first memory section using the selected block marker; and
when it is determined that the second object is in the first memory section, a root array associated with the selected block marker is updated to insure that the root array associated with the selected block marker includes a pointer to the second object.
-
-
4. A computer-implemented method as recited in claim 1 wherein when it is determined that the selected block includes a first object which references a second object, the step of performing the third garbage collection further includes:
-
determining whether the second object is in the second memory section using the selected block marker; and
when it is determined that the second object is in the second memory section, a root array associated with the selected block marker is scanned to identify references to other objects.
-
-
5. A computer-implemented method as recited in claim 4 further including following the references to other objects.
-
6. A computer-implemented method as recited in claim 1 wherein the plurality of blocks are arranged as a plurality of trains, the selected block being included in a first one of the plurality of trains, the step of performing the third garbage collection further including:
determining whether the second object is in a second one of the plurality of trains based at least in part on the status indicated by the marker associated with the block.
-
7. A computer-implemented method as recited in claim 6 wherein when it is determined that the second object is not in a second one of the plurality of trains, the method further includes releasing the second train.
-
8. A computer-implemented method as recited in claim 1 wherein the plurality of blocks are arranged as a plurality of cars, the plurality of cars further being arranged as a plurality of trains, the selected block being included in a first one of the plurality of cars that forms a selected one of the plurality of trains, the step of performing the third garbage collection further including:
determining whether the second object is in a second one of the plurality of cars that forms the selected train based at least in part on the status indicated by the marker associated with the block.
-
9. A computer-implemented method as recited in claim 8 wherein when it is determined that the second object is not in the second car of the selected train, the method further includes releasing the second car.
-
10. A computer-implemented method for dynamically managing memory associated with a computer system, the memory being divided into a plurality of blocks, the blocks each having an associated marker, the method comprising:
-
performing a first garbage collection on a selected one of the blocks;
performing a second garbage collection on the selected block, wherein the second garbage collection includes determining whether the selected block includes a first object which references a second object which is not included in the selected block based at least in part on a status indicated by the marker associated with the selected block, the status indicated by the marker including an indication of whether the reference to the second object was stored after the first garbage collection was performed; and
when the reference to the second object was stored after the first garbage collection was performed, creating a new root array using the selected block. - View Dependent Claims (11, 12, 13, 14, 15, 16)
determining whether the second object is in a second one of the plurality of trains based at least in part on the status indicated by the marker associated with the block.
-
-
13. A computer-implemented method as recited in claim 12 wherein when it is determined that the second object is not in a second one of the plurality of trains, the method further includes releasing the second train.
-
14. A computer-implemented method as recited in claim 10 wherein the plurality of blocks are arranged as a plurality of cars, the plurality of cars further being arranged as a plurality of trains, the selected block being included in a first one of the plurality of cars that forms a selected one of the plurality of trains, the step of performing the garbage collection further including:
determining whether the second object is in a second one of the plurality of cars that forms the selected train based at least in part on the status indicated by the marker associated with the block.
-
15. A computer-implemented method as recited in claim 14 wherein when it is determined that the second object is not in the second car of the selected train, the method further includes releasing the second car.
-
16. A computer-implemented method as recited in claim 10 further including an additional memory section, wherein when it is determined that the second object is not included in the selected block, the step of performing the garbage collection on the selected block further includes determining whether the second object is included in the additional memory section based at least in part on the status indicated by the marker associated with the selected block.
-
17. A computer-implemented method for allocating a selected object in computer memory, the computer memory including a first section, a second section, and an array of words associated with elements in the second section, the words being arranged to indicate whether the contents of their associated elements reference objects in the first section, the method comprising:
-
determining whether the first section is suitable for the selected object to be allocated;
allocating the selected object when it is determined that the first section is suitable for the object to be allocated; and
performing a garbage collection in the first section when it is determined that the first section is not suitable for the selected object to be allocated, wherein performing the garbage collection includes scanning the array of words to locate selected words that indicate that their associated elements in the second section reference particular objects in the first section, and wherein the particular objects in the first section are retained during the garbage collection. - View Dependent Claims (18, 19, 20, 21, 22)
following associations of roots within the associated elements in the second section, wherein following the associations of the roots includes updating the roots to new locations within the computer memory and updating the selected words.
-
-
19. A computer-implemented method as recited in claim 18 wherein updating the selected words includes:
-
determining when a selected one of the roots is in the second section and references a selected one of the particular objects is in the first section; and
when it is determined that the selected root is in the second section and references the selected particular object in the first section, updating the selected words to indicate that the selected root is in the second section and the selected particular object is in the first section.
-
-
20. A computer-implemented method as recited in claim 17 further including:
performing a garbage collection in the second section, wherein performing the garbage collection includes following associations of roots associated with selected ones of the elements, the roots being associated with the new generation, whereby following the associations of the roots involves updating some of the words in the array of words.
-
21. A computer-implemented method as recited in claim 20 wherein performing the garbage collection in the second section further includes:
-
scanning the array of markers to locate a first word selected from the array of words which indicates that its associated element in the second section is suitable for release; and
releasing the element.
-
-
22. A computer-implemented method as recited in claim 17 wherein scanning the array of words to locate selected words that indicate that their associated elements in the second section reference particular objects in the first section includes identifying a root array which includes addresses for the particular referenced objects.
-
23. A computer readable medium for use in a computer system including a first memory section and a second memory section that is arranged as a plurality of elements, the computer readable medium having computer code for configuring a marker, the marker being associated with a first element selected from the plurality of elements, the marker comprising:
-
a first indicator arranged to identify whether the first selected element references an object contained within the first memory section. - View Dependent Claims (24, 25, 26, 27, 28, 29, 30)
a second indicator arranged to identify whether the first selected element references a second element selected from the plurality of elements, the second selected element being included in the second car arrangement.
-
-
28. A computer readable medium for use in a computer system as recited in claim 27, wherein the marker further includes a reference to the second selected element, wherein the reference is a pointer to an array which includes an address associated with the second selected element.
-
29. A computer readable medium for use in a computer system as recited in claim 23 wherein the plurality of elements is organized such that a first set of the elements selected from the plurality of elements forms a first car arrangement and a second set of the elements selected from the plurality of elements forms a second car arrangement, the first selected element being included in the first car arrangement, the first car arrangement being a part of a first train and the second car arrangement being a part of a second train, the marker further including:
a second indicator arranged to identify whether the first selected element references a second element selected from the plurality of elements, the second selected element being included in the second car arrangement.
-
30. A computer readable medium for use in a computer system as recited in claim 29, wherein the marker further includes a reference to the second selected element, wherein the reference is a pointer to an array which includes an address associated with the second selected element.
-
31. A computer system comprising:
-
memory including a first memory section and a second memory section that is segmented into a plurality of blocks;
an array of markers, each marker corresponding to an associated block in the second memory section, the markers being configured to indicate when their associated blocks reference objects outside of their associated block;
a set of root arrays, the root arrays being arranged to hold addresses of the objects, wherein selected markers from the array of markers are associated with the set of root arrays;
a first garbage collector for reclaiming space within the first memory section; and
a second garbage collector for reclaiming space within the second memory section based at least in part upon the status of the markers in the array of markers. - View Dependent Claims (32, 33, 34, 35, 36, 37)
-
-
38. A computer system comprising:
-
memory that is segmented into a plurality of blocks;
an array of markers, each marker corresponding to an associated block in the memory, the markers being configured to indicate when their associated blocks reference objects outside of their associated block;
a set of root arrays, the root arrays being arranged to hold addresses of the objects, wherein selected markers from the array of markers are associated with the set of root arrays; and
a garbage collector for reclaiming space within the memory based at least in part upon the status of the markers in the array of markers. - View Dependent Claims (39, 40, 41)
-
-
42. A computer program product for dynamically managing memory associated with a computer system, the computer program product comprising:
-
computer code that performs a first garbage collection in a first memory section of the computer;
computer code that performs a second garbage collection on a second memory section of the computer, the second memory section being divided into a plurality of blocks, wherein the second garbage collection includes determining whether a block selected from the plurality of blocks includes a first object which references a second object which is not included in the selected block based at least in part on a status indicated by the marker associated with the selected block; and
a computer readable medium that stores the computer codes. - View Dependent Claims (43, 44, 45)
computer code that releases the selected block when it is determined that the first object does not reference a second object which is not included in the selected block.
-
-
44. A computer program product as recited in claim 42 further including:
-
computer code that determines whether the second object is in the first memory section using the selected block marker when it is determined that the selected block includes a first object which references a second object; and
computer code that updates a root array associated with the selected block marker to insure that the root array includes a pointer to the second object when it is determined that the second object is in the first memory section.
-
-
45. A computer program product as recited in claim 42 further including:
-
computer code that determines whether the second object is in the second memory section using the selected block marker when it is determined that the selected block includes a first object which references a second object; and
computer code that scans a root array associated with the selected block marker to identify references to other objects when it is determined that the second object is in the second memory section.
-
-
46. A computer program product for causing a processor of a computer system to dynamically manage memory associated with the computer system, the computer program product comprising:
-
computer code that performs a first garbage collection in a first memory section of the computer;
computer code that performs a second garbage collection on a second memory section of the computer, the second memory section being divided into a plurality of blocks, wherein the second garbage collection includes determining whether a block selected from the plurality of blocks includes a first object which references a second object which is not included in the selected block based at least in part on a status indicated by the marker associated with the selected block; and
a computer data signal embodied in a carrier wave that represents the computer codes. - View Dependent Claims (47, 48, 49)
computer code that releases the selected block when it is determined that the first object does not reference a second object which is not included in the selected block.
-
-
48. A computer program product as recited in claim 46 further including:
-
computer code that determines whether the second object is in the first memory section using the selected block marker when it is determined that the selected block includes a first object which references a second object; and
computer code that updates a root array associated with the selected block marker to insure that the root array includes a pointer to the second object when it is determined that the second object is in the first memory section.
-
-
49. A computer program product as recited in claim 46 further including:
-
computer code that determines whether the second object is in the second memory section using the selected block marker when it is determined that the selected block includes a first object which references a second object; and
computer code that scans a root array associated with the selected block marker to identify references to other objects when it is determined that the second object is in the second memory section.
-
Specification