Method and system for concurrent garbage collection
First Claim
1. A computer-implemented method of marking memory objects for collecting garbage for an executing application in a computer system, which when executed by the computer system causes the computer system to execute said method comprising:
- pausing the executing application;
cloning root information when the executing application is paused, the root information indicating live memory objects, wherein cloning root information includes locating program root objects in memory stacks and storing the program root objects, each live memory object being traceable back to one of the stored program root objects;
restarting the application after cloning the root information;
marking memory objects that are reachable from the stored program root objects using the cloned root information while the application is executing to indicate that the reachable memory objects are not to be collected, the reachable memory objects including memory objects that are live during marking and memory objects that become garbage after cloning the root information; and
after marking the reachable memory objects, collecting unmarked memory objects left unmarked during the act of marking.
1 Assignment
0 Petitions
Accused Products
Abstract
A method and system for concurrent garbage collection wherein live memory objects, i.e., not garbage, can be marked while an application executes. Root information is gleaned by taking a snapshot program roots or by arranging the stack to be scanned during execution of the program. Next, a first marking act is performed using the root information while the program executes. Modifications in the memory structure that occur during the concurrent marking act are logged or accumulated by a write watch module. The application is then paused or stopped to perform a second marking act using information from the write watch module. Following the second marking act, the garbage collection may be completed using various techniques.
76 Citations
11 Claims
-
1. A computer-implemented method of marking memory objects for collecting garbage for an executing application in a computer system, which when executed by the computer system causes the computer system to execute said method comprising:
-
pausing the executing application; cloning root information when the executing application is paused, the root information indicating live memory objects, wherein cloning root information includes locating program root objects in memory stacks and storing the program root objects, each live memory object being traceable back to one of the stored program root objects; restarting the application after cloning the root information; marking memory objects that are reachable from the stored program root objects using the cloned root information while the application is executing to indicate that the reachable memory objects are not to be collected, the reachable memory objects including memory objects that are live during marking and memory objects that become garbage after cloning the root information; and after marking the reachable memory objects, collecting unmarked memory objects left unmarked during the act of marking. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9)
-
-
10. A computer-implemented method of marking memory objects for collecting garbage memory objects for an executing application in a computer system, which when executed by the computer system causes the computer system to execute said method comprising:
-
cloning root information when the executing application is paused, the root information indicating memory objects in use by the executing application, wherein cloning root information includes locating program root objects in memory stacks and storing the program root objects, each memory object in use by the executing application being reachable from one of the stored program root objects; monitoring modifications made to memory objects to accumulate a list of modified memory objects, the modifications including at least one of requesting allocation of new memory objects, modifying existing memory objects, and creating new garbage memory objects; marking memory objects that are reachable from the stored program root objects while the application is executing to indicate whether or not each memory object is to be collected, the reachable memory objects including memory objects that are not garbage memory objects during the act of marking and memory objects that became garbage memory objects after cloning the root information; revisiting the modified memory objects on the list using the cloned root information, wherein revisiting includes determining whether the memory objects became garbage memory objects after cloning the root information; and after revisiting the modified memory objects, collecting unmarked memory objects left unmarked during the act of marking. - View Dependent Claims (11)
-
Specification