--- old/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/G1CollectedHeap.java 2019-02-15 20:10:19.387531975 +0100 +++ new/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/G1CollectedHeap.java 2019-02-15 20:10:18.811531979 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2019, 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 @@ -32,8 +32,9 @@ import sun.jvm.hotspot.debugger.Address; 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.LiveRegionsClosure; import sun.jvm.hotspot.gc.shared.PrintRegionClosure; +import sun.jvm.hotspot.gc.shared.SpaceClosure; import sun.jvm.hotspot.memory.MemRegion; import sun.jvm.hotspot.runtime.VM; import sun.jvm.hotspot.runtime.VMObjectFactory; @@ -138,6 +139,15 @@ } @Override + public void liveRegionsIterate(LiveRegionsClosure closure) { + Iterator iter = heapRegionIterator(); + while (iter.hasNext()) { + HeapRegion hr = iter.next(); + closure.doLiveRegions(hr); + } + } + + @Override public void printOn(PrintStream tty) { MemRegion mr = reservedRegion();