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

Reviewed-by: tschatzl, ayang
This commit is contained in:
Ivan Walulya 2025-05-02 12:54:09 +00:00
parent cf2f9ce820
commit 995d54161f

View File

@ -478,7 +478,7 @@ uint G1HeapRegionManager::find_contiguous_in_free_list(uint num_regions) {
uint G1HeapRegionManager::find_contiguous_allow_expand(uint num_regions) {
// Check if we can actually satisfy the allocation.
if (num_regions > available()) {
if (num_regions > (num_free_regions() + available())) {
return G1_NO_HRM_INDEX;
}
// Find any candidate.