Skip to content

Commit 6e5c0be

Browse files
committed
Prevent Eden from exceeding free heap after a heap resize failure
Currently, we protect against the eden size exceeding the available free heap space when no heap resize occurs. Extend this protection to handle heap resize failures (both expansion and contraction). For successful heap resize operations, heapReconfigured() is invoked, which triggers calculateEdenSize() to recalculate and adjust the eden size. Signed-off-by: lhu <linhu@ca.ibm.com>
1 parent da9f498 commit 6e5c0be

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

runtime/gc_vlhgc/MemorySubSpaceTarok.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,9 @@ MM_MemorySubSpaceTarok::performResize(MM_EnvironmentBase *env, MM_AllocateDescri
942942
resizeAmount = -(intptr_t)performContract(env, allocDescription);
943943
} else if (_expansionSize != 0) {
944944
resizeAmount = performExpand(env);
945-
} else {
945+
}
946+
947+
if (0 == resizeAmount) {
946948
/**
947949
* In case there is no heap resize, check if there is the case that free size is smaller than eden size
948950
* due to the conflict between eden resize and heap resize, recalculateEdenSize if it happens.

0 commit comments

Comments
 (0)