After JDK-8192647, a GC-request, once inside a safepoint, will run-to-completion. Therefore, callers who requesting GCs don't need to retry in a loop any more.
For example, the loop `ParallelScavengeHeap::collect` is unnecessary.
```
while (true) {
VM_ParallelGCCollect op(gc_count, full_gc_count, cause);
VMThread::execute(&op);
if (!GCCause::is_explicit_full_gc(cause)) {
return;
}
{
MutexLocker ml(Heap_lock);
if (full_gc_count != total_full_collections()) {
return;
}
}
}
```
For example, the loop `ParallelScavengeHeap::collect` is unnecessary.
```
while (true) {
VM_ParallelGCCollect op(gc_count, full_gc_count, cause);
VMThread::execute(&op);
if (!GCCause::is_explicit_full_gc(cause)) {
return;
}
{
MutexLocker ml(Heap_lock);
if (full_gc_count != total_full_collections()) {
return;
}
}
}
```
- links to
-
Review(master) openjdk/jdk/25032