< prev index next >
src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/HeapSummary.java
Print this page
@@ -27,10 +27,11 @@
import java.util.*;
import sun.jvm.hotspot.gc.epsilon.*;
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;
import sun.jvm.hotspot.memory.*;
import sun.jvm.hotspot.oops.*;
@@ -81,11 +82,15 @@
printValue("NewRatio = ", getFlagValue("NewRatio", flagMap));
printValue("SurvivorRatio = ", getFlagValue("SurvivorRatio", flagMap));
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:");
if (heap instanceof GenCollectedHeap) {
@@ -124,10 +129,18 @@
System.out.println("PS Old Generation");
printValMB("capacity = ", oldGen.capacity());
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());
} else if (heap instanceof ZCollectedHeap) {
ZCollectedHeap zheap = (ZCollectedHeap) heap;
< prev index next >