< prev index next >

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/serial/DefNewGeneration.java

Print this page


   1 /*
   2  * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


  75 
  76   public ContiguousSpace to() {
  77     return (ContiguousSpace) VMObjectFactory.newObject(ContiguousSpace.class, toSpaceField.getValue(addr));
  78   }
  79 
  80   public long capacity()            { return eden().capacity() + from().capacity(); /* to() is only used during scavenge */ }
  81   public long used()                { return eden().used()     + from().used();     /* to() is only used during scavenge */ }
  82   public long free()                { return eden().free()     + from().free();     /* to() is only used during scavenge */ }
  83   public long contiguousAvailable() { return eden().free(); }
  84 
  85   public String name() {
  86     return "default new generation";
  87   }
  88 
  89   public void spaceIterate(SpaceClosure blk, boolean usedOnly) {
  90     blk.doSpace(eden());
  91     blk.doSpace(from());
  92     if (!usedOnly) {
  93       blk.doSpace(to());
  94     }





  95   }
  96 
  97   public void printOn(PrintStream tty) {
  98     tty.print("  eden");
  99     eden().printOn(tty);
 100     tty.print("\n  from");
 101     from().printOn(tty);
 102     tty.print("\n  to  ");
 103     to().printOn(tty);
 104   }
 105 }
   1 /*
   2  * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


  75 
  76   public ContiguousSpace to() {
  77     return (ContiguousSpace) VMObjectFactory.newObject(ContiguousSpace.class, toSpaceField.getValue(addr));
  78   }
  79 
  80   public long capacity()            { return eden().capacity() + from().capacity(); /* to() is only used during scavenge */ }
  81   public long used()                { return eden().used()     + from().used();     /* to() is only used during scavenge */ }
  82   public long free()                { return eden().free()     + from().free();     /* to() is only used during scavenge */ }
  83   public long contiguousAvailable() { return eden().free(); }
  84 
  85   public String name() {
  86     return "default new generation";
  87   }
  88 
  89   public void spaceIterate(SpaceClosure blk, boolean usedOnly) {
  90     blk.doSpace(eden());
  91     blk.doSpace(from());
  92     if (!usedOnly) {
  93       blk.doSpace(to());
  94     }
  95   }
  96 
  97   public void liveRegionsIterate(LiveRegionsClosure closure) {
  98     closure.doLiveRegions(eden());
  99     closure.doLiveRegions(from());
 100   }
 101 
 102   public void printOn(PrintStream tty) {
 103     tty.print("  eden");
 104     eden().printOn(tty);
 105     tty.print("\n  from");
 106     from().printOn(tty);
 107     tty.print("\n  to  ");
 108     to().printOn(tty);
 109   }
 110 }
< prev index next >