From 4e53a9d9dfe7a1ac7c3d7402e5ca3a3d3fcbb709 Mon Sep 17 00:00:00 2001 From: Rui Li Date: Thu, 24 Jul 2025 18:34:26 +0000 Subject: [PATCH] 8357818: Shenandoah doesn't use shared API for printing heap before/after GC Reviewed-by: wkemper, kdnilsen --- src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp | 2 ++ .../share/gc/shenandoah/shenandoahGenerationalControlThread.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp b/src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp index 795bcc1cf92..ff62e8aa976 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp @@ -146,6 +146,7 @@ void ShenandoahControlThread::run_service() { // If GC was requested, we better dump freeset data for performance debugging heap->free_set()->log_status_under_lock(); + heap->print_before_gc(); switch (mode) { case concurrent_normal: service_concurrent_normal_cycle(cause); @@ -159,6 +160,7 @@ void ShenandoahControlThread::run_service() { default: ShouldNotReachHere(); } + heap->print_after_gc(); // If this was the requested GC cycle, notify waiters about it if (is_gc_requested) { diff --git a/src/hotspot/share/gc/shenandoah/shenandoahGenerationalControlThread.cpp b/src/hotspot/share/gc/shenandoah/shenandoahGenerationalControlThread.cpp index 54cf8b978df..42671c33525 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahGenerationalControlThread.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahGenerationalControlThread.cpp @@ -240,6 +240,7 @@ void ShenandoahGenerationalControlThread::run_gc_cycle(const ShenandoahGCRequest // Cannot uncommit bitmap slices during concurrent reset ShenandoahNoUncommitMark forbid_region_uncommit(_heap); + _heap->print_before_gc(); switch (gc_mode()) { case concurrent_normal: { service_concurrent_normal_cycle(request); @@ -261,6 +262,7 @@ void ShenandoahGenerationalControlThread::run_gc_cycle(const ShenandoahGCRequest default: ShouldNotReachHere(); } + _heap->print_after_gc(); } // If this cycle completed successfully, notify threads waiting for gc