[Gc] Alignment, Executable memory and MMX registers

Ben Hutchings ben.hutchings at businesswebsoftware.com
Wed Oct 20 03:51:13 PDT 2004

Hans Boehm <Hans.Boehm at hp.com> wrote:
> > Currently, on Windows, the collector does go through the whole tree
> > (or rather graph) of objects referred to from the root set.  There
> > are techniques called generational and incremental garbage 
> > collection that can avoid this, but the necessary supporting code
> > has not yet been written for Windows.  I may do so at some point.
> I believe incremental GC should basically work on Windows, at least
> in the absence of threads.

I'm not interested in anything that only works with single threads,
though I realise Matt might be.

> I think there are the standard issues with
> system calls that write to the heap.  And for some reason, incremental
> collection is no longer tested by default with Windows threads.
> I don't recall why that was turned off.  But I think single threaded
> tests do run with incremental GC.

What I was talking about doing was implementing virtual dirty bits
using the GetWriteWatch API present in recent versions of Windows, which
is explicitly intended for use by GCs.  I didn't realise that there was
already an implementation using VirtualProtect and exception-handling!

> Having said that, incremental GC currently rarely improves throughput,
> and probably costs more on Windows than Linux.

With a very large heap (a gigabyte or so) a full GC takes several
seconds so it's well worth spreading out the cost somehow.


More information about the Gc mailing list