JNI patches

Boehm, Hans hans_boehm@hp.com
Tue Apr 3 09:10:00 GMT 2001


Good point.

Another alternative on many platforms is to treat all writable regions of
memory (that aren't part of the garbage collected heap) as roots.  This
requires something like a /proc interface to find the writable mappings.
The code to do this under Linux and a few other systems is mostly there.
(This is basically how things work under win32 and Irix anyway.)

But I think we are all in agreement that this is mostly a solution in search
of a problem.  So long as most of the standard libraries use CNI, and JNI is
thus not a performance bottleneck, the more conventional the JNI
implementation, the better.

Hans

> -----Original Message-----
> From: Jeff Sturm [ mailto:jsturm@one-point.com ]
> Sent: Monday, April 02, 2001 4:53 PM
> To: java@gcc.gnu.org
> Subject: RE: JNI patches
> 
> 
> 
> 
> On Mon, 2 Apr 2001, Boehm, Hans wrote:
> > The collector normally does not scan objects allocated with 
> C malloc (except
> > on one or two platforms where that's hard to avoid).  The 
> easiest way to
> > change that is to redirect the C malloc to 
> GC_malloc_uncollectable, but that
> > sometimes creates startup ordering issues.  It should work 
> on Linux, but I'm
> > not sure about various other platforms.
> 
> It's not a general solution.  For one thing, with JNI 
> invocation programs 
> are free to startup (and bind to malloc, etc.) before loading the gcj
> runtime.
> 
> I don't see how local refs are avoidable if JNI is going to 
> work.  There
> are probably faster ways to handle them, though.  (I'm not 
> worried about
> global refs, which are relatively uncommon.)
> 
> Jeff
> 
> 



More information about the Java mailing list