RFR(M) 8186834:Expanding old area without full GC in parallel GC
thomas.schatzl at oracle.com
Fri Oct 20 10:05:29 UTC 2017
On Fri, 2017-10-20 at 18:13 +0900, Michihiro Horie wrote:
> Hi Thomas,
> Thanks a lot for the discussion, also sorry for my late reply.
> I think MinHeapFreeRatio tunes the size of heap expansion, while
> UseAdaptiveGenerationSizePolicyBeforeMajorCollection decides to
> expand heap, whose size is decided by MinHeapFreeRatio, without full
I agree, but one could tune MinHeapFreeRatio so that the amount of full
gcs and the time spent in there would be much smaller than by default.
> >Particularly if, as you mention, full gc will not yield a
> significant amount of freed memory, both methods seem to achieve the
> exact same effect.
> Yes, so I think heap once expands up to Xmx, both methods have the
> same effect.
> >Otherwise, if you were able to pass different VM arguments to the
> >different VMs, the use of -Xms (instead of that new flag) would seem
> >straightforward to me (Only specifying -Xms will not actually commit
> >the memory, so there is no difference in actual memory use).
> I did not tell this (sorry), but currently Xms and Xmx are set
> explicitly in the VM arguments because we want to use only needed
As mentioned before, even with -Xms == -Xmx, memory is not actually
backed with physical memory until actually touched by default.
I could imagine that -Xms==-Xmx would yield better (initial)
performance as the young gen will be sized larger.
So the suggested change would only make a difference in case you also
explicitly pre-touched that memory from what I understood. Not sure if
that is what you do or desire (enabling memory pretouch is typically
only used with -Xms==-Xmx, so not sure if that is a good use case).
More information about the hotspot-dev