RFR: 8355681: G1HeapRegionManager::find_contiguous_allow_expand ignores free regions when checking regions available for allocation

Ivan Walulya iwalulya at openjdk.org
Wed Apr 30 12:15:47 UTC 2025


On Wed, 30 Apr 2025 12:01:37 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

>> src/hotspot/share/gc/g1/g1HeapRegionManager.cpp line 481:
>> 
>>> 479: uint G1HeapRegionManager::find_contiguous_allow_expand(uint num_regions) {
>>> 480:   // Check if we can actually satisfy the allocation.
>>> 481:   if (num_regions > (num_free_regions() + available())) {
>> 
>> The name "available" is too vague -- without looking at its impl, one could think free regions should be "available" as well. I wonder if sth like "num_uncommitted" is more precise.
>
> This seems to be a pre-existing issue. Filed https://bugs.openjdk.org/browse/JDK-8355976.
> 
> Afair this member has always been called that way.

Yeah, I tripped up on that too.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24915#discussion_r2068536314


More information about the hotspot-gc-dev mailing list