< prev index next >
agent/src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java
Print this page
@@ -25,10 +25,11 @@
package sun.jvm.hotspot.tools;
import java.util.*;
import sun.jvm.hotspot.gc_interface.*;
import sun.jvm.hotspot.gc_implementation.g1.*;
+import sun.jvm.hotspot.gc_implementation.shenandoah.*;
import sun.jvm.hotspot.gc_implementation.parallelScavenge.*;
import sun.jvm.hotspot.gc_implementation.shared.*;
import sun.jvm.hotspot.debugger.JVMDebugger;
import sun.jvm.hotspot.memory.*;
import sun.jvm.hotspot.oops.*;
@@ -74,11 +75,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 SharedHeap) {
@@ -138,10 +143,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 {
throw new RuntimeException("unknown CollectedHeap type : " + heap.getClass());
}
System.out.println();
@@ -182,10 +195,18 @@
l = getFlagValue("ParallelGCThreads", flagMap);
System.out.println("with " + l + " thread(s)");
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");
}
private void printPSYoungGen(PSYoungGen youngGen) {
System.out.println("PS Young Generation");
< prev index next >