[Gc] segmentation violation

Boehm, Hans hans.boehm at hp.com
Mon Nov 29 10:50:09 PST 2004


It's unfortunately, not very surprising that this fails.  Mixing garbage
collectors is tricky, to say the least.  Problems include:

- There is no real way to collect cycles spanning the two heaps.
(In theory, the collectors could communicate with some suitable,
and fairly complex, protocol to deal with this.  But I'm not sure I know
of any system that handles this without potentially serious GC performance
problems.)

- You need each GC to treat the other heaps as roots, or somehow protect
objects referenced only from the other heap from premature collection.
Depending on the details of your application, GC_MALLOC'ed objects may
be getting collected prematurely, if C pointers are stored only inside Java
objects (presumably as Java longs).  Doing this correctly is nontrivial, since
you don't want to treat empty uninitialized space as part of the root set for
the other GC.

- The implementations need to coexist.  I don't know enough about HotSpot to
tell whether that's an issue here.  I wouldn't be too surprised if both collectors
try to catch SIGSEGV, at least under some conditions.

I vaguely recall someone getting away with this under very restricted conditions.
But you will almost certainly run into some problems.

Another alternative might be to run everything under gcj.  But it looks like
there are other issues with gcj and JBOSS.

Hans
> -----Original Message-----
> From: gc-bounces at napali.hpl.hp.com 
> [mailto:gc-bounces at napali.hpl.hp.com]On Behalf Of 
> Chau_Fu at sunmoretec.co.jp
> Sent: Monday, November 29, 2004 12:31 AM
> To: gc at napali.hpl.hp.com
> Subject: [Gc] segmentation violation
> 
> 
> Dear All,
> 
> I am using the GC in a JNI library which was called by EJB.
> But the segmentation violation occures when GC_MALLOC was called.
> 
> gc6.3
> Application Server:JBOSS 4.0
> Java VM: Java HotSpot(TM) Server VM 1.4.2-b28,Sun Microsystems Inc.
> OS:Asianux release 1.0 (Kernel 2.4.21-9.30AX on an i686)
> 
> If someone could show me any possible reasons, I'd really 
> appreciate it.
> 
> Thanks.
> 
> Qiao HU
> Chau_Fu at sunmoretec.co.jp
> _______________________________________________
> Gc mailing list
> Gc at linux.hpl.hp.com
> http://www.hpl.hp.com/hosted/linux/mail-archives/gc/
> 


More information about the Gc mailing list