8209163: SA: Show Object Histogram asserts with ZGC
authorpliden
Fri, 14 Sep 2018 14:44:11 +0200
changeset 51741 ed9b1200dd81
parent 51740 f79cfb07f13f
child 51742 3dd95a83791b
8209163: SA: Show Object Histogram asserts with ZGC Reviewed-by: ysuenaga, jcbeyler
src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java
src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/ProgressiveHeapVisitor.java
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java	Fri Sep 14 14:45:31 2018 +0200
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java	Fri Sep 14 14:44:11 2018 +0200
@@ -37,6 +37,7 @@
 import sun.jvm.hotspot.gc.epsilon.*;
 import sun.jvm.hotspot.gc.g1.*;
 import sun.jvm.hotspot.gc.parallel.*;
+import sun.jvm.hotspot.gc.z.*;
 import sun.jvm.hotspot.memory.*;
 import sun.jvm.hotspot.runtime.*;
 import sun.jvm.hotspot.types.*;
@@ -366,6 +367,10 @@
     } else if (heap instanceof G1CollectedHeap) {
         G1CollectedHeap g1h = (G1CollectedHeap) heap;
         g1h.heapRegionIterate(lrc);
+    } else if (heap instanceof ZCollectedHeap) {
+       // Operation (currently) not supported with ZGC. Print
+       // a warning and leave the list of live regions empty.
+       System.err.println("Warning: Operation not supported with ZGC");
     } else if (heap instanceof EpsilonHeap) {
        EpsilonHeap eh = (EpsilonHeap) heap;
        liveRegions.add(eh.space().top());
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/ProgressiveHeapVisitor.java	Fri Sep 14 14:45:31 2018 +0200
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/ProgressiveHeapVisitor.java	Fri Sep 14 14:44:11 2018 +0200
@@ -50,6 +50,7 @@
     this.usedSize = usedSize;
     visitedSize = 0;
     userHeapVisitor.prologue(usedSize);
+    thunk.heapIterationFractionUpdate(0.0);
   }
 
   public boolean doObj(Oop obj) {