JDK-8232722 : G1 archive region deallocation may shrink the heap below -Xms
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 14
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2019-10-21
  • Updated: 2022-11-16
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 21
21Unresolved
Description
When an archive region is deallocated (e.g. if we did not manage to map in or find an archive), the G1CollectedHeap::dealloc_archive_regions() method shrinks the heap (i.e. uncommits the region) unconditionally.

This is wrong in case this would decrease the allocated heap below -Xms.

Particularly noticeable with -Xms == -Xmx and running with gc+region=trace debugging: at the beginning G1 allocates a region as closed archive, but then *uncommits* it.

This may cause really minor performance hiccups/regressions, but often G1 re-commits that region later anyway.

Afaict this is a bug introduced with the initial archive regions support.