RE: FW: Garbage collection issues in GCJ

"Ben Keppler" <[email protected]>
Newsgroups gmane.comp.gcc.java.devel
Message-ID <[email protected]>
Hi David,

Thanks for your response.  We have been unable to find documentation
detailing how to change the GC configuration including knobs for setting
the max heap size.  Could you direct us to documentation on how to do
that?  Also, are there alternatives to making a native call to
_Jv_SetGCFreeSpaceDivisor() (e.g. set an environment variable or compile
with a symbol defined in the appropriate way)?  It would be preferable
if we didn't have to implement a tight coupling to GCJ in that fashion.

Thanks for your help.

Ben Keppler, Software Engineer
E-mail: [email protected] * Voice: 828.684.7474 * Fax:
8282.684.7874

-----Original Message-----
From: David Daney [mailto:[email protected]] 
Sent: Monday, January 17, 2011 12:32 PM
To: Ben Keppler
Cc: [email protected]
Subject: Re: FW: Garbage collection issues in GCJ

On 01/17/2011 05:08 AM, Ben Keppler wrote:

> We are using gcj for a time sensitive application.  One of the
> requirements of the application is that messages be transmitted
> within a 60ms timeframe.  Unfortunately, the Boehm GC used in gcj is
> not generational and thus every collection is of the "stop the
> world" variety.  We are observing (using "GC_PRINT_STATS") regular
> collections that stop the world for periods in the 400ms range.
> This is a problem for us.
>
> The comments I have found on the "incremental" setting for the
> Boehm GC indicate that it doesn't work with gcj, so that would not
> appear to be an option.  My question is, are there other GC options
> (perhaps a generational garbage collector) available for gcj?  My
> research has revealed none other than TinyGC, an option that would
> exacerbate rather than relieve our problems.  Alternatively, are
> there settings on the Boehm GC that might relieve our problems?  I
> would appreciate any information you could provide.

1) GCJ's libjava is not really suited for realtime applications.

2) Setting the GCFreeSpaceDivisor (by calling
_Jv_SetGCFreeSpaceDivisor()) to a low value (try 5) may result in
shorter, but more frequent, GC intervals.  Limiting the total heap
size will also reduce the amount of work done by the GC during each
collection.

David Daney
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.