From 812f475bc4ea84225e8bbb0b5a677eed0af864dd Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Mon, 21 Aug 2023 09:02:01 +0000 Subject: [PATCH] 8314501: Shenandoah: sun/tools/jhsdb/heapconfig/JMapHeapConfigTest.java fails Reviewed-by: cjplummer, sspitsyn --- .../share/classes/sun/jvm/hotspot/tools/HeapSummary.java | 7 +++---- .../jdk/sun/tools/jhsdb/heapconfig/JMapHeapConfigTest.java | 3 +-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/HeapSummary.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/HeapSummary.java index d29e3a68811..c586a20e866 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/HeapSummary.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/HeapSummary.java @@ -86,10 +86,8 @@ public class HeapSummary extends Tool { printValMB("MetaspaceSize = ", getFlagValue("MetaspaceSize", flagMap)); printValMB("CompressedClassSpaceSize = ", getFlagValue("CompressedClassSpaceSize", flagMap)); printValMB("MaxMetaspaceSize = ", getFlagValue("MaxMetaspaceSize", flagMap)); - if (heap instanceof ShenandoahHeap) { - printValMB("ShenandoahRegionSize = ", ShenandoahHeapRegion.regionSizeBytes()); - } else { - printValMB("G1HeapRegionSize = ", HeapRegion.grainBytes()); + if (heap instanceof G1CollectedHeap) { + printValMB("G1HeapRegionSize = ", HeapRegion.grainBytes()); } System.out.println(); @@ -138,6 +136,7 @@ public class HeapSummary extends Tool { long num_regions = sh.numOfRegions(); System.out.println("Shenandoah Heap:"); System.out.println(" regions = " + num_regions); + printValMB("region size = ", ShenandoahHeapRegion.regionSizeBytes()); printValMB("capacity = ", num_regions * ShenandoahHeapRegion.regionSizeBytes()); printValMB("used = ", sh.used()); printValMB("committed = ", sh.committed()); diff --git a/test/jdk/sun/tools/jhsdb/heapconfig/JMapHeapConfigTest.java b/test/jdk/sun/tools/jhsdb/heapconfig/JMapHeapConfigTest.java index 71d112157b2..119ab55afca 100644 --- a/test/jdk/sun/tools/jhsdb/heapconfig/JMapHeapConfigTest.java +++ b/test/jdk/sun/tools/jhsdb/heapconfig/JMapHeapConfigTest.java @@ -57,8 +57,7 @@ public class JMapHeapConfigTest { "NewRatio", "SurvivorRatio", "MetaspaceSize", - "CompressedClassSpaceSize", - "G1HeapRegionSize"}; + "CompressedClassSpaceSize"}; // Test can't deal with negative jlongs: // ignoring MaxMetaspaceSize