RFC: Reduce GC root set to speed up GC...

Andrew Haley aph@redhat.com
Wed Sep 8 09:38:00 GMT 2004


David Daney writes:
 > Recently there have been some discussions about GC performance issues.
 > We are also looking at some things in this area.
 > 
 > One thing that Hans Boehm suggested was to reduce the size of the
 > root set.
 > 
 > I have been thinking about how that might be done.  Here is one
 > idea:
 > 
 > Create a separate object file section (".gc.roots" or some such
 > thing) that all global pointers (aka references) get put into.

.data.gc.roots puts it in the data section.

 > GCJ would then place all static pointers in this section instead of
 > .data.  All of the native code in libgcj would do the same using
 > __attribute__ ((section (".gc.roots"))) where needed.

Looks like this plan might be ELF only.  That would be unfortunate,
but perhaps tolerable.

 > It should be possible to identify these sections at runtime in a
 > similar manner to the way the GC is finding .data sections
 > currently
 > 
 > Would something like this be doable?

We'd need not only to find all of our static roots, but to change the
CNI documentation to make very sure that users do the right thing.
More rules for CNI users are probably a Bad Thing.

 > Would it be worth the effort?

I think so.  It's a good idea because it makes all the root pointers
live in the same pages -- great memory locality.

Andrew.



More information about the Java mailing list