Integrated: 8316319: Generational ZGC: The SoftMaxHeapSize might be wrong when CDS decreases the MaxHeapSize
Stefan Karlsson
stefank at openjdk.org
Fri Sep 22 06:41:20 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.
This pull request has now been integrated.
Changeset: fe862639
Author: Stefan Karlsson <stefank at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/fe862639e7ce40f5adef0e482b1fb9c718e061a3
Stats: 40 lines in 6 files changed: 30 ins; 10 del; 0 mod
8316319: Generational ZGC: The SoftMaxHeapSize might be wrong when CDS decreases the MaxHeapSize
Reviewed-by: aboldtch, serb
-------------
PR: https://git.openjdk.org/jdk/pull/15841
More information about the hotspot-gc-dev
mailing list