< prev index next >

src/hotspot/share/gc/parallel/adjoiningGenerations.cpp

Print this page
rev 51962 : 8210716: Detailed GC logging request misses some
Contributed-by: manc@google.com
   1 /*
   2  * Copyright (c) 2003, 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  *


 105                                 max_high_byte_size);
 106     _old_gen = new PSOldGen(init_low_byte_size,
 107                             min_low_byte_size,
 108                             max_low_byte_size,
 109                             "old", 1);
 110 
 111     // The virtual spaces are created by the initialization of the gens.
 112     _young_gen->initialize(young_rs, alignment);
 113     assert(young_gen()->gen_size_limit() == young_rs.size(),
 114       "Consistency check");
 115     _old_gen->initialize(old_rs, alignment, "old", 1);
 116     assert(old_gen()->gen_size_limit() == old_rs.size(), "Consistency check");
 117   }
 118 }
 119 
 120 size_t AdjoiningGenerations::reserved_byte_size() {
 121   return virtual_spaces()->reserved_space().size();
 122 }
 123 
 124 void log_before_expansion(bool old, size_t expand_in_bytes, size_t change_in_bytes, size_t max_size) {
 125   Log(heap, ergo) log;
 126   if (!log.is_debug()) {
 127    return;
 128   }
 129   log.debug("Before expansion of %s gen with boundary move", old ? "old" : "young");
 130   log.debug("  Requested change: " SIZE_FORMAT_HEX "  Attempted change: " SIZE_FORMAT_HEX,
 131                         expand_in_bytes, change_in_bytes);
 132   ResourceMark rm;
 133   LogStream ls(log.debug());
 134   ParallelScavengeHeap::heap()->print_on(&ls);
 135   log.debug("  PS%sGen max size: " SIZE_FORMAT "K", old ? "Old" : "Young", max_size/K);
 136 }
 137 
 138 void log_after_expansion(bool old, size_t max_size) {
 139   Log(heap, ergo) log;
 140   if (!log.is_debug()) {
 141    return;
 142   }
 143   log.debug("After expansion of %s gen with boundary move", old ? "old" : "young");
 144   ResourceMark rm;
 145   LogStream ls(log.debug());
 146   ParallelScavengeHeap::heap()->print_on(&ls);
 147   log.debug("  PS%sGen max size: " SIZE_FORMAT "K", old ? "Old" : "Young", max_size/K);
 148 }
 149 
 150 // Make checks on the current sizes of the generations and
 151 // the constraints on the sizes of the generations.  Push
 152 // up the boundary within the constraints.  A partial
 153 // push can occur.
 154 void AdjoiningGenerations::request_old_gen_expansion(size_t expand_in_bytes) {
 155   assert(UseAdaptiveSizePolicy && UseAdaptiveGCBoundary, "runtime check");
 156 
 157   assert_lock_strong(ExpandHeap_lock);
 158   assert_locked_or_safepoint(Heap_lock);
 159 


   1 /*
   2  * Copyright (c) 2003, 2018, 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  *


 105                                 max_high_byte_size);
 106     _old_gen = new PSOldGen(init_low_byte_size,
 107                             min_low_byte_size,
 108                             max_low_byte_size,
 109                             "old", 1);
 110 
 111     // The virtual spaces are created by the initialization of the gens.
 112     _young_gen->initialize(young_rs, alignment);
 113     assert(young_gen()->gen_size_limit() == young_rs.size(),
 114       "Consistency check");
 115     _old_gen->initialize(old_rs, alignment, "old", 1);
 116     assert(old_gen()->gen_size_limit() == old_rs.size(), "Consistency check");
 117   }
 118 }
 119 
 120 size_t AdjoiningGenerations::reserved_byte_size() {
 121   return virtual_spaces()->reserved_space().size();
 122 }
 123 
 124 void log_before_expansion(bool old, size_t expand_in_bytes, size_t change_in_bytes, size_t max_size) {
 125   Log(gc, ergo, heap) log;
 126   if (!log.is_debug()) {
 127    return;
 128   }
 129   log.debug("Before expansion of %s gen with boundary move", old ? "old" : "young");
 130   log.debug("  Requested change: " SIZE_FORMAT_HEX "  Attempted change: " SIZE_FORMAT_HEX,
 131                         expand_in_bytes, change_in_bytes);
 132   ResourceMark rm;
 133   LogStream ls(log.debug());
 134   ParallelScavengeHeap::heap()->print_on(&ls);
 135   log.debug("  PS%sGen max size: " SIZE_FORMAT "K", old ? "Old" : "Young", max_size/K);
 136 }
 137 
 138 void log_after_expansion(bool old, size_t max_size) {
 139   Log(gc, ergo, heap) log;
 140   if (!log.is_debug()) {
 141    return;
 142   }
 143   log.debug("After expansion of %s gen with boundary move", old ? "old" : "young");
 144   ResourceMark rm;
 145   LogStream ls(log.debug());
 146   ParallelScavengeHeap::heap()->print_on(&ls);
 147   log.debug("  PS%sGen max size: " SIZE_FORMAT "K", old ? "Old" : "Young", max_size/K);
 148 }
 149 
 150 // Make checks on the current sizes of the generations and
 151 // the constraints on the sizes of the generations.  Push
 152 // up the boundary within the constraints.  A partial
 153 // push can occur.
 154 void AdjoiningGenerations::request_old_gen_expansion(size_t expand_in_bytes) {
 155   assert(UseAdaptiveSizePolicy && UseAdaptiveGCBoundary, "runtime check");
 156 
 157   assert_lock_strong(ExpandHeap_lock);
 158   assert_locked_or_safepoint(Heap_lock);
 159 


< prev index next >