RFR: 8352969: G1: Improve testability of optional collections [v10]

Albert Mingkun Yang ayang at openjdk.org
Thu Sep 11 11:22:53 UTC 2025


On Wed, 10 Sep 2025 15:53:28 GMT, Guanqiang Han <ghan at openjdk.org> wrote:

>> This PR introduces a new diagnostic flag EvacuateAllOptionalRegions to force G1 GC to evacuate all optional regions regardless of the predicted pause time. The motivation is to allow testing and validation of optional region evacuation behavior without being constrained by the remaining pause time.
>
> Guanqiang Han has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Update TestOptionalRegionGC.java
>   
>   Correct the formatting errors

src/hotspot/share/gc/g1/g1CollectionSet.cpp line 417:

> 415:   G1CSetCandidateGroupList* from_marking_groups = &candidates()->from_marking_groups();
> 416: 
> 417: #ifdef ASSERT

I'd suggest removing `#ifdef ASSERT`; the compiler should be able to remove unreachable code in an optimized build.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/26880#discussion_r2340268442


More information about the hotspot-gc-dev mailing list