< prev index next >
src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/G1CollectedHeap.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2011, 2018, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
--- 1,7 ----
/*
! * 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 30,41 ****
import java.util.Observer;
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.PrintRegionClosure;
import sun.jvm.hotspot.memory.MemRegion;
import sun.jvm.hotspot.runtime.VM;
import sun.jvm.hotspot.runtime.VMObjectFactory;
import sun.jvm.hotspot.types.AddressField;
import sun.jvm.hotspot.types.CIntegerField;
--- 30,42 ----
import java.util.Observer;
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.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;
import sun.jvm.hotspot.types.AddressField;
import sun.jvm.hotspot.types.CIntegerField;
*** 136,145 ****
--- 137,155 ----
public CollectedHeapName kind() {
return CollectedHeapName.G1;
}
@Override
+ public void liveRegionsIterate(LiveRegionsClosure closure) {
+ Iterator<HeapRegion> iter = heapRegionIterator();
+ while (iter.hasNext()) {
+ HeapRegion hr = iter.next();
+ closure.doLiveRegions(hr);
+ }
+ }
+
+ @Override
public void printOn(PrintStream tty) {
MemRegion mr = reservedRegion();
tty.print("garbage-first heap");
tty.print(" [" + mr.start() + ", " + mr.end() + "]");
< prev index next >