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.