[RFA] boehm-gc for AIX

Boehm, Hans hans_boehm@hp.com
Tue Jan 29 13:13:00 GMT 2002

Based on my pat experience (which predates JNI, unfortunately), I would be
very careful about designing the CNI interface so as to minimize the chance
for overlooked pointers into the garbage collected heap.

I would greatly prefer that we either:

1) Arrange for statically allocated variables to be scanned by the GC by
default.  I guess we could describe this as the "opt-out" model for root
registration. Or

2) Have a plan for diagnosing missing root registrations, e.g. an
environment variable setting that asks the collector to register all static
data segments up to address N as roots.  (This would still require finding
the main data segment on platforms like AIX.)

The first basically requires a conservative collector, in that you at least
need to be able to handle C unions conservatively.  The second means only
that you lose some debugging functionality if you go to a nonconservative

I think it would also be nice to have an established way to redirect
malloc/new in CNI code so that they allocate traced, but not collected,
memory.  As it stands, I believe there is no easy way to get the collector
to scan C/C++ objects in CNI?


> -----Original Message-----
> From: Bryce McKinlay [mailto:bryce@waitaki.otago.ac.nz]
> Sent: Monday, January 28, 2002 3:12 PM
> To: Jeff Sturm
> Cc: Tom Tromey; David Edelsohn; Boehm, Hans; java@gcc.gnu.org
> Subject: Re: [RFA] boehm-gc for AIX
> Jeff Sturm wrote:
> >CNI invocation is another problem... it's unfortunate that 
> the CNI spec
> >says nothing about static roots, so it seems to imply the 
> existence of a
> >conservative GC.
> >
> We could certainly add something to the spec to say that any global 
> variables holding Java objects must be declared in Java. This would 
> probibly make things easier for a theoretical non-conservative GC in 
> future. I don't think I've seen any CNI code which does 
> otherwise anyway.
> regards
> Bryce.

More information about the Java mailing list