# HG changeset patch # User pliden # Date 1536929051 -7200 # Node ID ed9b1200dd818d7e5c4c5ad903b4a4ff48c9fb57 # Parent f79cfb07f13f1ed91287d6325d1c3cd2b80d66d0 8209163: SA: Show Object Histogram asserts with ZGC Reviewed-by: ysuenaga, jcbeyler diff -r f79cfb07f13f -r ed9b1200dd81 src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ObjectHeap.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()); diff -r f79cfb07f13f -r ed9b1200dd81 src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/ProgressiveHeapVisitor.java --- 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) {