src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/HeapSummary.java
changeset 52925 9c18c9d839d3
parent 51498 9a5200b84046
child 53517 20ba6a7f897a
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/HeapSummary.java	Mon Dec 10 17:34:49 2018 +0300
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/HeapSummary.java	Mon Dec 10 15:47:44 2018 +0100
@@ -29,6 +29,7 @@
 import sun.jvm.hotspot.gc.g1.*;
 import sun.jvm.hotspot.gc.parallel.*;
 import sun.jvm.hotspot.gc.serial.*;
+import sun.jvm.hotspot.gc.shenandoah.*;
 import sun.jvm.hotspot.gc.shared.*;
 import sun.jvm.hotspot.gc.z.*;
 import sun.jvm.hotspot.debugger.JVMDebugger;
@@ -83,7 +84,11 @@
       printValMB("MetaspaceSize            = ", getFlagValue("MetaspaceSize", flagMap));
       printValMB("CompressedClassSpaceSize = ", getFlagValue("CompressedClassSpaceSize", flagMap));
       printValMB("MaxMetaspaceSize         = ", getFlagValue("MaxMetaspaceSize", flagMap));
-      printValMB("G1HeapRegionSize         = ", HeapRegion.grainBytes());
+      if (heap instanceof ShenandoahHeap) {
+         printValMB("ShenandoahRegionSize     = ", ShenandoahHeapRegion.regionSizeBytes());
+      } else {
+         printValMB("G1HeapRegionSize         = ", HeapRegion.grainBytes());
+      }
 
       System.out.println();
       System.out.println("Heap Usage:");
@@ -126,6 +131,14 @@
          printValMB("used     = ", oldGen.used());
          printValMB("free     = ", oldFree);
          System.out.println(alignment + (double)oldGen.used() * 100.0 / oldGen.capacity() + "% used");
+      } else if (heap instanceof ShenandoahHeap) {
+         ShenandoahHeap sh = (ShenandoahHeap) heap;
+         long num_regions = sh.numOfRegions();
+         System.out.println("Shenandoah Heap:");
+         System.out.println("   regions   = " + num_regions);
+         printValMB("capacity  = ", num_regions * ShenandoahHeapRegion.regionSizeBytes());
+         printValMB("used      = ", sh.used());
+         printValMB("committed = ", sh.committed());
       } else if (heap instanceof EpsilonHeap) {
          EpsilonHeap eh = (EpsilonHeap) heap;
          printSpace(eh.space());
@@ -183,6 +196,14 @@
            return;
        }
 
+       l = getFlagValue("UseShenandoahGC", flagMap);
+       if (l == 1L) {
+           System.out.print("Shenandoah GC ");
+           l = getFlagValue("ParallelGCThreads", flagMap);
+           System.out.println("with " + l + " thread(s)");
+           return;
+       }
+
        System.out.println("Mark Sweep Compact GC");
    }