[gclist] Experience with conservative GC sought

David Gadbois gadbois@cyc.com
Fri, 16 Jan 1998 11:18:27 -0600

   From: sperber@Informatik.Uni-Tuebingen.De (Michael Sperber \[Mr. Preprocessor\])
   Date: 16 Jan 1998 09:41:51 +0100

   I'm looking for accounts, if part of research or just anecdotal, of
   experience with using conservative GC in long-running applications
   with large heaps and big changes in the size of the live data.


   scm uses its own conservative collector which only scans the stack
   conservatively but does precise tracing for objects inside the
   heap.  I have used scm to run programs with (comparatively) high
   rates of data allocation.  The experience has been similar as with
   PLT: The heap grows far beyond the size of the live data and
   doesn't shrink back.

I do something similar and have not encountered problems.  Possible
explanations for the difference are:

1. On 32-bit machines, I locate the heap starting at the second
   quadrant of the address space.  This happens to be far removed from
   the stack and BSS in most address space layouts.  Perhaps folks who
   see lots of false positives might have their heaps near non-heap
   data.  It would be interesting to see of Wentworth's results also
   hold for 64-bit machines, where you have a lot more leeway about
   where to put the heap.

2. The codes I run are not numeric-intensive, so there are very few
   large numeric values on the stack that can be mistaken for object

3. There are relatively few stack-allocated blobs of random data such
   as IO buffers, which are a good source of false positives.

4. The decision about when to do a GC favors doing it in top-level
   loops where there is relatively little on the stack.

5. Objects have to go through several ephemeral generations before
   they get to the rarely (~days) GCed generation, so perhaps false
   positives on one GC get wiped before they get to the point where
   they cause problems.

6. Everything is word-aligned, so there no problem with interpreting
   cross-word values as object references.

It does seem counter-intuitive that conservative GC can work so well.
Over in comp.arch, someone posted a reference to Richard Hamming's
article "The Unreasonable Effectiveness of Mathematics"
(http://web.nps.navy.mil/~frazier/unreas.html).  Someone should write
"The Unreasonable Effectiveness of Conservative GC."

--David Gadbois