src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/G1CollectedHeap.java
changeset 49463 ccb003941743
parent 47602 d4380ee1cbe9
child 49628 88478047bc8f
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/G1CollectedHeap.java	Mon Mar 19 14:20:28 2018 -0500
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/G1CollectedHeap.java	Tue Mar 20 11:24:32 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,6 +33,7 @@
 import sun.jvm.hotspot.gc.shared.CollectedHeap;
 import sun.jvm.hotspot.gc.shared.CollectedHeapName;
 import sun.jvm.hotspot.gc.shared.SpaceClosure;
+import sun.jvm.hotspot.gc.shared.PrintRegionClosure;
 import sun.jvm.hotspot.memory.MemRegion;
 import sun.jvm.hotspot.runtime.VM;
 import sun.jvm.hotspot.runtime.VMObjectFactory;
@@ -40,6 +41,7 @@
 import sun.jvm.hotspot.types.CIntegerField;
 import sun.jvm.hotspot.types.Type;
 import sun.jvm.hotspot.types.TypeDataBase;
+import sun.jvm.hotspot.tools.HeapSummary;
 
 // Mirror class for G1CollectedHeap.
 
@@ -133,6 +135,14 @@
         tty.print("garbage-first heap");
         tty.print(" [" + mr.start() + ", " + mr.end() + "]");
         tty.println(" region size " + (HeapRegion.grainBytes() / 1024) + "K");
+
+        HeapSummary sum = new HeapSummary();
+        sum.printG1HeapSummary(this);
+    }
+
+    public void printRegionDetails(PrintStream tty) {
+        PrintRegionClosure prc = new PrintRegionClosure(tty);
+        heapRegionIterate(prc);
     }
 
     public G1CollectedHeap(Address addr) {