RFR: 8232722: G1 archive region deallocation may shrink the heap below -Xms
Ashutosh Mehra
duke at openjdk.org
Wed May 31 13:15:58 UTC 2023
On Wed, 31 May 2023 07:14:11 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:
> 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.
Right, that's the current behavior as well and not uncommitting the regions in `dealloc_archive_regions` doesn't change that. The difference appears only when the archive region mapping fails. If the regions are uncommitted it would bring back heap size to Xms. If not, heap size will remain slightly above Xms, which is same as the current behavior when mapping succeeds.
The advantage is avoiding the need to track committed regions which avoids leaks more G1 specific details to CDS code. Adding GC policy specific details would make it harder to implement https://bugs.openjdk.org/browse/JDK-8296263. I am trying to move G1 specific code out of CDS in https://github.com/openjdk/jdk/pull/14208.
So if not uncommitting simplifies the things then why not?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/14145#issuecomment-1570213437
More information about the hotspot-gc-dev
mailing list