RFR (S): 6490394: G1: Allow heap shrinking / memory unmapping after reclaiming regions during Remark
Thomas Schatzl
thomas.schatzl at oracle.com
Mon Dec 10 15:47:56 UTC 2018
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.
> > 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.
> 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.
Thanks,
Thomas
More information about the hotspot-gc-dev
mailing list