RFR: 8232722: G1 archive region deallocation may shrink the heap below -Xms
Thomas Schatzl
tschatzl at openjdk.org
Wed May 31 07:16:56 UTC 2023
On Tue, 30 May 2023 21:36:26 GMT, Ashutosh Mehra <duke at openjdk.org> wrote:
> @tschatzl what if the regions allocated for archive objects are not uncommitted but just added to the free list in `dealloc_archive_regions`? That would also prevent heap going below Xms and would avoid tracking committed regions. Do you see any issue if the regions are not uncommitted?
No real issue, but no real advantage either. In case of -Xms != -Xmx this would mean that the `main` method will not start with heap size of -Xms, but additional regions.
Given that CDS is enabled by default, this would effectively mean that unless disabled, the VM would always (effectively) start (at `main`) with an initial heap size a bit larger than requested.
This is allowed (initial heap size is somewhat of a hint), but unexpected I assume.
The question is, should G1 try to honor requested initial heap size or not? (Similar to https://bugs.openjdk.org/browse/JDK-8308854)
-------------
PR Comment: https://git.openjdk.org/jdk/pull/14145#issuecomment-1569625576
More information about the hotspot-gc-dev
mailing list