Copying GC
Adam Campbell <[email protected]> Thu, 10 Jan 2008 11:26:58 -0500
| Newsgroups | gmane.comp.programming.garbage-collection.general |
|---|---|
| Message-ID | <[email protected]> |
Hello, I have been researching different Garbage Collector implementations for a new programming language (Mark & Sweep, Copying, Generational, Incremental). I have noticed that many GC implementations use an explicit marking stack during the marking phase (as opposed to an implicit stack -- recursion). So it seems to me that the marking phase employs a depth- first search of the root nodes to mark reachable nodes thus being able to distinguish between garbage and live objects. I have also noticed that many copying GCs (Generational) employ a breadth first search to copy objects from a younger generation to an older generation. What I am questioning is why one uses a depth first search (w/ an explicit stack) and the other a breadth first search? If anyone could shed some light on this it would be greatly appreciated. Thank you _________________________________________________________________ Make distant family not so distant with Windows Vista® + Windows Live™. http://www.microsoft.com/windows/digitallife/keepintouch.mspx?ocid=TXT_TAGLM_CPC_VideoChat_distantfamily_012008