RFR: 8316319: Generational ZGC: The SoftMaxHeapSize might be wrong when CDS decreases the MaxHeapSize
Sergey Bylokhov
serb at openjdk.org
Thu Sep 21 17:19:39 UTC 2023
On Wed, 20 Sep 2023 12:40:22 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:
> Generational ZGC sets SoftMaxHeapSize to 90% of the MaxHeapSize if the user has not specified the maximum heap size with any of the available flags. Unfortunately, this break when CDS later on decreases the MaxHeapSize.
>
> I propose that we solve this by moving the code that sets the SoftMaxHeapSize to the point after CDS and the GC has done its final tweaks to the MaxHeapSize.
>
> This can be easily reproduced just by running:
> java -XX:+UseZGC -XX:+ZGenerational -Xshare:dump -Xlog:gc+init -version
>
> This wasn't caught in testing because our test infrastructure uses MaxRamPercentage to set the maximum heap size. I've manually verified that the patch fixes the issue and that SoftMaxHeapSize is set as expected.
Marked as reviewed by serb (Reviewer).
-------------
PR Review: https://git.openjdk.org/jdk/pull/15841#pullrequestreview-1638356936
More information about the hotspot-gc-dev
mailing list