G1 "to-space exhausted" causes used heap space to increase?
Thomas Schatzl
thomas.schatzl at oracle.com
Tue Mar 3 11:18:01 UTC 2015
Hi Simone,
On Tue, 2015-03-03 at 08:16 +0100, Simone Bordet wrote:
> Jenny,
>
> On Mon, Mar 2, 2015 at 11:45 PM, Yu Zhang <yu.zhang at oracle.com> wrote:
> > I am starting a FAQ page, I added this question
> > https://blogs.oracle.com/g1gc/
> >
> > 9. What is the recommended way to limit Eden size for g1?
> >
[...]
> > G1 will pick up other settings, such as NewRatio, NewSize, MaxNewSize, -Xmn
> >
> > -Xmn: the same as NewSize=MaxNewSize
> >
> > only -XX:NewSize is set, the young gen size is between specified NewSize and
> > G1MaxNewSizePercent
> >
> > only -XX:MaxNewSize is set, the young gen size is between specified
> > G1NewSizePercent and MaxNewSize.
> >
> > Both -XX:NewSize and -XX:MaxNewSize are used, young gen will be between
> > those 2 sizes. But when heap size change, the young gen size will not
> > change accordingly.
> >
> > If -XX:NewRatio is used, the Young Gen size is heap size * newRatio.
> > NewRatio is ignored if it is used with NewSize and MaxNewSize.
>
> I take that all of these options disable ergonomics and therefore the
> attempts of G1 to respect MaxGCPauseMillis ?
> Or setting one or some of these will still make G1 try to respect
> MaxGCPauseMillis ?
G1 will attempt to respect pause time as much as possible, except if you
set the min and max limits to the same value. This is the case if you do
that explicitly for both, or if NewRatio is set.
Basically, by setting one or the other value, you fix that bound to a
certain value.
I recommend only setting G1MaxNewSize or MaxNewSize for the case
mentioned in the original post. It is appropriate for cases when there
may be sudden changes in the survival rate of eden that the gc cannot
predict to avoid missing the pause time goal excessively, which seems to
be the case.
Thanks,
Thomas
More information about the hotspot-gc-use
mailing list