JDK-8357445 : G1: Time-Based Heap Uncommit During Idle Periods
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2025-05-21
  • Updated: 2025-07-17
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.
Other
tbdUnresolved
Related Reports
Blocks :  
Relates :  
Relates :  
Description
JDK-8238687 evaluates and resizes the heap based on garbage collections, i.e. every garbage collection g1 resizes the heap.

Doing heap sizing based on garbage collections has a big disadvantage: if there are no garbage collections (due to no application activity) there is a risk that a large amount of heap is kept committed unnecessarily for a long time.

There needs to be some other form of regular re-evaluation of heap size to combat that.


This also somewhat ties in with JDK-8213198 that is about regularly cleaning out other resources (although in that case it can happen that there is lots of gc activity, but just no whole heap analysis for a long time)

There are also periodic GCs (JDK-8204089, JDK-8317755), but their functionality probably needs to be preserved as they are, or maybe they can be reused in some way (e.g. never triggering full gc).

Another option is to regularly trigger a young gc (without concurrent start/whole heap analysis), but that may be a too large disruption.

ZGC tracks last-used time of a region and regularly uncommits those that have not been in use for a certain amount of time (ZUncommitDelay; as the only strategy to free heap regions currently).

Comments
A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/26240 Date: 2025-07-10 10:15:58 +0000
10-07-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/26207 Date: 2025-07-09 02:29:10 +0000
09-07-2025

https://github.com/openjdk/jdk21u-dev/compare/master...mo-beck:jdk21u-dev:JDK-8357445/time-based-resizing-JDK21
17-06-2025