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

Thomas Schatzl tschatzl at openjdk.org
Wed Apr 30 12:15:46 UTC 2025


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

>> src/hotspot/share/gc/g1/g1CollectedHeap.cpp line 909:
>> 
>>> 907:     // For humongous objects, we should have expanded the heap on the first
>>> 908:     // attempt_allocation_at_safepoint above.
>>> 909:     result = expand_and_allocate(word_size);
>> 
>> Why `attempt_allocation_at_safepoint` performs expansion for humongous objs but not ordinary objs? Since `attempt_allocation_at_safepoint` doesn't contain "expand" in its name, I'd expect it not to perform expansion at all. (If expansion for humongous objs is critical, I wonder if it makes sense to branch on `is_humongous` at the beginning of this method and handle those two cases in two diff paths.)
>
> This also seems pre-existing. Can you file an issue?

Actually the whole hunk seems to be unrelated to the actual functional change.

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

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


More information about the hotspot-gc-dev mailing list