RFR (S): 6490394: G1: Allow heap shrinking / memory unmapping after reclaiming regions during Remark
Ruslan Synytsky
rs at jelastic.com
Mon Dec 10 17:43:53 UTC 2018
On Mon, 10 Dec 2018 at 16:48, Thomas Schatzl <thomas.schatzl at oracle.com>
wrote:
> Hi,
>
> see inline.
>
> On Mon, 2018-12-10 at 16:22 +0100, Ruslan Synytsky wrote:
> > Dear Thomas and Sangheon, hope you are doing great.
> >
> > I just noticed an important improvement related to vertical scaling
> > and would like to clarify details mentioned in the release notes
> >
> > > By default, G1 may now give back Java heap memory to the operating
> > > system during any concurrent mark cycle. G1 will respect default
> > > Java heap sizing policies at that time.
> >
> > Does it mean that G1 is smart enough now by default and users do not
> > need to deal with loadaverage and G1PeriodicGCInterval that we
> > introduced in JEP 346?
>
> If there is enough activity to trigger marking cycles, G1 will give
> back memory according to default heap sizing rules, i.e. current heap
> occupancy, MinHeapFreeRatio, MaxHeapFreeRatio and of course the value
> of Xms.
>
> JEP 346 is about triggering and detecting a marking cycle (or continue
> cleaning up the old gen, or a full gc as option) if there is no
> activity.
>
> So the JEP 346 controls are still required if you want G1 to give back
> memory on idle (to define what is "idle").
>
> Note that during review we changed the idle detection off by default -
> that does not impact the functionality giving back memory to the OS
> during a marking cycle.
>
Ok, more clear now.
>
> > > This behavior may be disabled by changing minimum Java heap size
> > > via the -Xms option.
> > At the same time if a user adjusts Xms option then he/she does not
> > get this "smart behaviour" at all.
> >
>
> This sentence should indicate that you can disable giving back memory
> to the OS by modifying the Xms value. In particular, setting the Xms to
> the Xmx value - which is a rule that is part of the default heap sizing
> policy.
>
Then I think the wording in the release notes is confusing as there is only
one case when changing Xms disables giving memory back, specifically when
Xms = Xmx.
> > Are these rephrased statements correct?
>
> Almost :) Corrections above.
>
> Note that the implementation of JEP 346 has been pushed today, so it
> will be JDK12 no matter what - there is only some post-push JEP work to
> do.
>
It's great! I will run some tests on my side later this week.
Thanks
>
> Thanks,
> Thomas
>
>
>
--
Ruslan
CEO @ Jelastic <https://jelastic.com/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/hotspot-gc-dev/attachments/20181210/a083fe93/attachment.htm>
More information about the hotspot-gc-dev
mailing list