4 ms·
Neither in the article nor it the paper they mention cycles in references. Does it solve it in any way?
by vilda 15y ago
Neither in the article nor it the paper they mention cycles in references. Does it solve it in any way?
- chrisb 15y agoGarbage collectors have no problem with reference cycles. A GC works by finding all objects that are reachable (referenced by some other object or a root), then discarding all other objects. So a cyclic data structure is completely discarded as soon as there are no live references to any of its objects. As usual, Wikipedia has lots more information: http://en.wikipedia.org/wiki/Garbage_collection_(computer_science) http://en.wikipedia.org/wiki/Garbage_collection_(computer_sc... GC roots are generally things like: static/global variables, active stack frames (function parameters and local variable), CPU registers.
- rayiner 15y agoBDW GC is a tracing collector. It doesn't need to have any special handle of cycles--either a cycle is reachable from the root set, in which case it is marked and considered alive, or it is not, and is never even seen by the collector before being reclaimed.