System and method for memory reclamation
First Claim
1. A method of memory reclamation, comprising:
- markings a first memory object as in use when an attempt to alter a reference to the first memory object is detected by a software write barrier;
marking a second memory object as in use when the second memory object is visited by a garbage collector;
reclaiming a third memory object marked not in use; and
lowering a priority level of a garbage collector when the reclamation of the third memory object has been completed.
3 Assignments
0 Petitions
Accused Products
Abstract
A method for memory reclamation is disclosed that includes marking a memory object when an attempt to alter a reference to the memory object is detected by a software write barrier. Marking be by using representations (“black,” “white”, “gray”) stored as part of a garbage collection information data structure associated with each memory object. Initially, all allocated memory objects are marked white. Objects are then processed such that objects referenced by pointers are marked gray. Each object marked gray is then processed to determine objects referenced by pointers in it, and such objects are marked gray. When all objects referenced by pointers in the selected gray objected have been processed, the selected gray object is marked black. When all processing has been completed, objects still marked white may be reclaimed. Also described is a garbage collector which runs as a task concurrently with other tasks. A priority of the garbage collector may be increased to prevent interruption during certain parts of the garbage collection procedure.
104 Citations
25 Claims
-
1. A method of memory reclamation, comprising:
-
markings a first memory object as in use when an attempt to alter a reference to the first memory object is detected by a software write barrier;
marking a second memory object as in use when the second memory object is visited by a garbage collector;
reclaiming a third memory object marked not in use; and
lowering a priority level of a garbage collector when the reclamation of the third memory object has been completed. - View Dependent Claims (2, 3, 4, 5)
-
-
6. A method for memory reclamation, comprising:
-
marking a first memory object when an attempt to alter a reference to the first object is detected by a software write barrier;
reading the contents of a stack, the stack containing a reference to a referenced memory object;
marking the referenced memory object;
raising a priority level of a garbage collector to a raised level before the steps of reading the contents of a stack and marking the referenced memory object; and
maintaining the priority level of the garbage collector at a raised level during the steps of reading the contents of a stack and marking the referenced memory object. - View Dependent Claims (7)
-
-
8. A method for memory reclamation, comprising:
-
marking a first memory object as in use when an attempt to alter a reference to the first memory object is detected by a software write barrier;
reading the contents of a stack, the stack containing a reference to a referenced memory object;
marking the referenced memory object as in use;
interpreting a word contained in the stack as a pointer, the pointer referencing a location in a potentially referenced memory object; and
marking the potentially referenced memory object as in use.
-
-
9. A method for memory reclamation, comprising:
-
marking a first memory object as in use when an attempt to alter a reference to the first memory object is detected by a software write barrier;
reading the contents of a register associated with a task;
interpreting the contents of the register as a pointer, the pointer referencing a location in a potentially referenced memory object; and
marking the potentially referenced memory object as in use.
-
-
10. A method for memory reclamation, comprising:
-
marking a first memory object when an attempt to alter a reference to the first memory object is detected by a software write barrier;
marking a second memory object when the second memory object is visited by a garbage collector;
reclaiming an unmarked memory object;
repeating the steps of marking the second memory object and reclaiming the unmarked memory object; and
controlling the frequency of repetition of the steps of marking the second memory object and reclaiming the unmarked memory object;
wherein the frequency of repetition is controlled by adjusting the priority of a garbage collector.
-
-
11. A method for memory reclamation, comprising:
-
marking a first memory object when an attempt to alter a reference to the first memory object is detected by a software write barrier;
marking a second memory object when the second memory object is visited by a garbage collector;
reading the contents of a global memory location, the global memory location containing a reference to a third referenced memory object;
marking the third referenced memory object;
reading the contents of a stack, the stack containing a reference to a fourth referenced memory object;
marking the fourth referenced memory object;
raising a priority level of a garbage collector to a raised level before the steps of reading the contents of the stack and marking the fourth referenced memory object;
maintaining the priority level of the garbage collector at a raised level during the steps of reading the contents of the stack and marking the fourth referenced memory object;
lowering the priority level of the garbage collector when the steps of reading the contents of the stack and marking the fourth referenced memory object are completed; and
reclaiming an unmarked memory object;
lowering the priority level of the garbage collector when the step of reclaiming the unmarked memory object is completed;
wherein the steps of reading the contents of the stack and marking the fourth referenced memory object are performed atomically.
-
-
12. A system comprising:
-
a software write barrier, the software write barrier marking a first memory object when an attempt is made to alter a reference to the first memory object;
a garbage collector, the garbage collector visiting and marking a second memory object, the garbage collector reclaiming a third memory object that has not been marked;
a garbage collector controller, the garbage collector controller controlling the frequency and duration of execution of the garbage collector;
a priority control scheme, the garbage collector controller using the priority control scheme to control the frequency and duration of execution of the garbage collector. - View Dependent Claims (13, 14, 15, 16, 17)
-
-
18. A method, comprising
receiving a software module, the software module including at least one instruction that modifies a pointer, the pointer referencing a memory object; - and
inserting a software write barrier in the at least one instruction that modifies the pointer;
wherein the software write barrier includes computer code that tests a variable indicative of whether one of the memory object has been visited by a garbage collector, and the memory object is available for reclamation. - View Dependent Claims (19, 20, 21, 22)
- and
-
23. A system, comprising:
a compiler, the compiler receiving a software module, the software module including at least one instruction that modifies a pointer, the compiler automatically inserting a software write barrier in the at least one instruction that modifies the pointer.
-
24. An article of manufacture comprising a computer-readable medium having stored thereon instructions adapted to be executed by a processor, the instructions which, when executed, define a series of steps to be used to control memory reclamation, said steps comprising:
-
marking a first memory object as in use when the first memory object is visited by a garbage collector;
marking a second memory object as in use when an attempt to alter a reference to the second memory object is detected by a software write barrier;
reclaiming a third memory object; and
lowering a priority level of a garbage collector in response to the reclamation of the third memory object.
-
-
25. An article of manufacture comprising a computer-readable medium having stored thereon instructions adapted to be executed by a processor, the instructions which, when executed, define a series of steps to be used to control a method, said steps comprising:
-
receiving a software module, the software module including at least one instruction that modifies a pointer; and
automatically inserting a software write barrier in the at least one instruction that modifies the pointer.
-
Specification