--- old/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/CollectedHeap.java 2018-11-28 19:11:44.684705235 +0100 +++ new/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/CollectedHeap.java 2018-11-28 19:11:44.534706339 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2015, 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 @@ -75,10 +75,6 @@ public abstract CollectedHeapName kind(); - public int cell_header_size() { - return 0; - } - public String oopAddressDescription(OopHandle handle) { return handle.toString(); } --- old/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shenandoah/ShenandoahHeap.java 2018-11-28 19:11:45.293700754 +0100 +++ new/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shenandoah/ShenandoahHeap.java 2018-11-28 19:11:45.137701902 +0100 @@ -91,11 +91,6 @@ } @Override - public int cell_header_size() { - return VM.getVM().getHeapWordSize(); - } - - @Override public void printOn(PrintStream tty) { MemRegion mr = reservedRegion(); tty.print("Shenandoah heap"); --- old/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java 2018-11-28 19:11:45.908696228 +0100 +++ new/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java 2018-11-28 19:11:45.751697383 +0100 @@ -246,15 +246,13 @@ } } - int cell_header_size = heap.cell_header_size(); - for (int i = 0; i < liveRegions.size(); i += 2) { Address bottom = (Address) liveRegions.get(i); Address top = (Address) liveRegions.get(i+1); try { // Traverses the space from bottom to top - OopHandle handle = bottom.addOffsetToAsOopHandle(cell_header_size); + OopHandle handle = bottom.addOffsetToAsOopHandle(0); while (handle.lessThan(top)) { Oop obj = null; @@ -291,7 +289,7 @@ if ( (cmsSpaceOld != null) && cmsSpaceOld.contains(handle)) { handle = handle.addOffsetToAsOopHandle(CompactibleFreeListSpace.adjustObjectSizeInBytes(obj.getObjectSize()) ); } else { - handle = handle.addOffsetToAsOopHandle(obj.getObjectSize() + cell_header_size); + handle = handle.addOffsetToAsOopHandle(obj.getObjectSize()); } } } @@ -371,8 +369,9 @@ G1CollectedHeap g1h = (G1CollectedHeap) heap; g1h.heapRegionIterate(lrc); } else if (heap instanceof ShenandoahHeap) { - ShenandoahHeap sh = (ShenandoahHeap) heap; - sh.heapRegionIterate(lrc); + // Operation (currently) not supported with Shenandoah GC. Print + // a warning and leave the list of live regions empty. + System.err.println("Warning: Operation not supported with ZGC"); } else if (heap instanceof ZCollectedHeap) { // Operation (currently) not supported with ZGC. Print // a warning and leave the list of live regions empty.