Re: Memory used during GC

Darius Blasband <[email protected]> Fri, 14 Jan 2005 11:46:33 +0100
Newsgroups gmane.comp.programming.garbage-collection.general
Message-ID <[email protected]>
We rather use a queue than a stack - various experiments lead us to 
conclude that fewer cells
were required if grey objects were processed FIFO . When the queue fills 
up, we swap half
of it on disk, read back when the queue gets empty.

It is a bit brutal, but then again, this queue is size in such a way 
that only
the biggest systems require this disk access, up to a point where the 
performance penalty is
essantially irrelevant.

D.

David Detlefs - Sun Microsystems Labs BOS wrote:

>Calum --
>
>Another approach that we use in a couple of places in Sun collectors
>is to allocate a fixed size stack to hold references to grey objects.
>If this stack overflows, record that fact, and at the end of marking
>restart the marking process, traversing the heap to find marked
>objects, treating them as roots.  This process will eventually
>terminate.  With even quite small stacks relative to total heap size,
>you can make this overflow quite unlikely (for "reasonable" programs
>that don't have very long pointer chains.)
>
>Hope this is useful...
>
>  
>