From f84be36dd59ae6b00aea334944b8266ecf8f5cbd Mon Sep 17 00:00:00 2001 From: William Kemper Date: Fri, 17 Oct 2025 16:54:20 +0000 Subject: [PATCH] 8241066: Shenandoah: fix or cleanup SH::do_full_collection Reviewed-by: shade --- src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp b/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp index b2fd32d2fd0..84f5c3362ac 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp @@ -1576,8 +1576,8 @@ void ShenandoahHeap::collect_as_vm_thread(GCCause::Cause cause) { // cycle. We _could_ cancel the concurrent cycle and then try to run a cycle directly // on the VM thread, but this would confuse the control thread mightily and doesn't // seem worth the trouble. Instead, we will have the caller thread run (and wait for) a - // concurrent cycle in the prologue of the heap inspect/dump operation. This is how - // other concurrent collectors in the JVM handle this scenario as well. + // concurrent cycle in the prologue of the heap inspect/dump operation (see VM_HeapDumper::doit_prologue). + // This is how other concurrent collectors in the JVM handle this scenario as well. assert(Thread::current()->is_VM_thread(), "Should be the VM thread"); guarantee(cause == GCCause::_heap_dump || cause == GCCause::_heap_inspection, "Invalid cause"); } @@ -1587,7 +1587,10 @@ void ShenandoahHeap::collect(GCCause::Cause cause) { } void ShenandoahHeap::do_full_collection(bool clear_all_soft_refs) { - //assert(false, "Shouldn't need to do full collections"); + // This method is only called by `CollectedHeap::collect_as_vm_thread`, which we have + // overridden to do nothing. See the comment there for an explanation of how heap inspections + // work for Shenandoah. + ShouldNotReachHere(); } HeapWord* ShenandoahHeap::block_start(const void* addr) const {