8315548: G1: Document why VM_G1CollectForAllocation::doit() may allocate without completing a GC

Reviewed-by: tschatzl
This commit is contained in:
Ivan Walulya 2023-09-05 10:12:24 +00:00
parent 9013b03244
commit 5a2e151d48

View File

@ -127,6 +127,10 @@ void VM_G1CollectForAllocation::doit() {
if (_word_size > 0) {
// An allocation has been requested. So, try to do that first.
// During the execution of this VM operation, there may have been a concurrent active
// GCLocker, potentially leading to expansion of the Eden space by other mutators.
// If the Eden space were expanded, this allocation request might succeed without
// the need for triggering a garbage collection.
_result = g1h->attempt_allocation_at_safepoint(_word_size,
false /* expect_null_cur_alloc_region */);
if (_result != nullptr) {