RFR 8357445: G1: Time-Based Heap Uncommit During Idle Periods (AHS)
Monica Beckwith
Monica.Beckwith at microsoft.com
Wed Jul 16 00:59:33 UTC 2025
Hi all,
Please review the time-based uncommit during idle periods feature that will help AHS for G1.
**Overview:** This enhancement introduces a time-based heap uncommit mechanism that operates independently of garbage collection cycles. The implementation tracks region activity using timestamps and proactively uncommits empty memory regions during low-activity periods, providing memory efficiency improvements.
**Key Implementation Points:**
- Background periodic task (G1HeapEvaluationTask) for heap evaluation
- Region-level timestamp tracking in G1HeapRegion
- Conservative algorithm: max 25% of inactive regions or 10% of total regions per evaluation
- VM operation-based uncommitting for thread safety
- Configurable parameters with sensible defaults
**Testing:** I have added 4 comprehensive tests for this feature:
- TestG1RegionUncommit: Basic uncommit functionality and edge cases
- TestTimeBasedHeapSizing: Overall feature behavior and integration
- TestTimeBasedRegionTracking: Region activity tracking and lifecycle
- TestTimeBasedHeapConfig: Parameter validation and configuration
**Performance Results:** SPECjbb2015 testing shows 34% heap reduction (7168MB → 4704MB) with minimal performance impact during benchmark runs.
**Links:**
- Changes: https://github.com/openjdk/jdk/pull/26240/files
- Webrev: https://openjdk.github.io/cr/?repo=jdk&pr=26240&range=01
- PR: https://github.com/microsoft/openjdk-workstreams/tree/main/G1-time-based-uncommit
- Issue: https://bugs.openjdk.org/browse/JDK-8357445
- Documentation: https://github.com/microsoft/openjdk-workstreams/tree/main/G1-time-based-uncommit
The documentation includes performance analysis with graphs and comprehensive usage guides.
Thanks,
Monica
More information about the hotspot-gc-dev
mailing list