RFR: 8316319: Generational ZGC: The SoftMaxHeapSize might be wrong when CDS decreases the MaxHeapSize
Stefan Karlsson
stefank at openjdk.org
Wed Sep 20 12:47:00 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.
@mrserb - thanks for reporting this bug! Do you want to test this patch in your test infra?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/15841#issuecomment-1727650256
More information about the hotspot-gc-dev
mailing list