changeset 51741:ed9b1200dd81

8209163: SA: Show Object Histogram asserts with ZGC Reviewed-by: ysuenaga, jcbeyler
author pliden
date Fri, 14 Sep 2018 14:44:11 +0200
parents f79cfb07f13f
children 3dd95a83791b
files src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/ProgressiveHeapVisitor.java
diffstat 2 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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) {