public inbox for java@gcc.gnu.org
 help / color / mirror / Atom feed
From: Hans Boehm <Hans.Boehm@hp.com>
To: Ben Keppler <bkeppler@tridentms.com>
Cc: David Daney <ddaney@caviumnetworks.com>,
	Florian Weimer <fw@deneb.enyo.de>,
	    "java@gcc.gnu.org" <java@gcc.gnu.org>
Subject: RE: FW: Garbage collection issues in GCJ
Date: Mon, 24 Jan 2011 18:45:00 -0000	[thread overview]
Message-ID: <alpine.DEB.2.00.1101241035440.28190@localhost6.localdomain6> (raw)
In-Reply-To: <3C7F46E08E936B478463BFFA776CDAD3016E67AD@tmsmail.domain2.local>

The major mechanism for limiting GC pauses is incremental GC.
I suspect that the GC used in GCJ generally supports that.  But it
requires the client code to follow some rules, and I think that
part was never fully debugged for GCJ.  The main issue here is that
the collector tracks modified pages by catching write faults, but
operating systems like Linux don't make this possible if the fault
occurs inside a system call.  Thus we need to make sure that system
calls don't write to parts of the heap that the GC must track.

Depending on the heap size, it may sometimes be possible to keep
GC pauses acceptable by just making the GC faaster, e.g. by
making more of the heap pointer-free.

GC pauses are often not that sensitive to the overall heap size,
since the sweep phase of the collector always runs incrementally,
and the cost of the mark phase depends mostly on the amount
of live data.  I would be surprised if limiting the heap size
solved the problem.

The collector itself does support abortable collections, i.e. a
mechanism for aborting a collection if the application finds that
it needs to get control back.  But that essentially discards the
work done so far, and I think not too many people have found it
useful.  This does not currently have GCJ support, but that might
be relatively eaasy to add.

Hans

On Mon, 24 Jan 2011, Ben Keppler wrote:

> Hi David,
>
> I understood your meaning to be what you reiterated in response to
> Florian.  In fact, in our testing with the Sun JVM, we obtained the
> performance characteristics we wanted by turning on the incremental GC
> and limiting the size of the eden space so that garbage collections take
> as little time as possible.  Because we are on a single-core system
> without hyperthreading, even non-world-stopping garbage collections must
> be limited in duration.
>
> As far as I can tell, the only possible option with GCJ and the Boehm GC
> is limiting the total size of the heap to reduce the pause.  However, I
> don't think even that is going to be adequate.  If GCJ were up on the
> latest version of Boehm GC and the incremental mode worked, that might
> solve our problem.  At this point I think we may be forced into using
> the JVM.
>
> Ben Keppler, Software Engineer
> Trident Micro Systems
> E-mail: bkeppler@tridentms.com * Voice: 828.684.7474 * Fax:
> 8282.684.7874
>
> -----Original Message-----
> From: David Daney [mailto:ddaney@caviumnetworks.com]
> Sent: Monday, January 24, 2011 12:45 PM
> To: Florian Weimer
> Cc: Ben Keppler; java@gcc.gnu.org
> Subject: Re: FW: Garbage collection issues in GCJ
>
> On 01/22/2011 01:53 PM, Florian Weimer wrote:
>> * Ben Keppler:
>>
>>> 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.
>>
>> GCJ allocates as much memory as your application needs.  I think what
>> David meant was that you should change your application to put less
>> data into the Java heap (either by using the C heap, or by splitting
>> it into multiple processes).
>>
>
> No, that is not what I meant at all.
>
> At some point in any non-trivial program's execution, there will be a
> memory allocation request that cannot be met from the existing pools of
> free memory.  At this point the runtime memory allocator must make a
> decision.  Should it run a garbage collection cycle to try to free up
> some existing memory, or should it get more memory from the operating
> system.
>
> My suggestion was to adjust the policy parameters such that it chooses
> the garbage collection option more often.  This results in a smaller
> total memory footprint, and thus faster garbage collection cycles.  The
> trade off is that you end up doing more garbage collection and less real
>
> work.  This may be acceptable though, if latency is important.
>
> David Daney
>

      reply	other threads:[~2011-01-24 18:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-17 13:09 Ben Keppler
2011-01-17 17:32 ` David Daney
2011-01-17 18:57   ` Ben Keppler
2011-01-22 21:53     ` Florian Weimer
2011-01-23 19:12       ` Boehm, Hans
2011-01-24 17:45       ` David Daney
2011-01-24 17:59         ` Ben Keppler
2011-01-24 18:45           ` Hans Boehm [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.00.1101241035440.28190@localhost6.localdomain6 \
    --to=hans.boehm@hp.com \
    --cc=bkeppler@tridentms.com \
    --cc=ddaney@caviumnetworks.com \
    --cc=fw@deneb.enyo.de \
    --cc=java@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).