src/share/vm/gc_implementation/shared/adaptiveSizePolicy.cpp

Print this page




   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  *
  23  */
  24 #include "incls/_precompiled.incl"
  25 #include "incls/_adaptiveSizePolicy.cpp.incl"
  26 






  27 elapsedTimer AdaptiveSizePolicy::_minor_timer;
  28 elapsedTimer AdaptiveSizePolicy::_major_timer;
  29 
  30 // The throughput goal is implemented as
  31 //      _throughput_goal = 1 - ( 1 / (1 + gc_cost_ratio))
  32 // gc_cost_ratio is the ratio
  33 //      application cost / gc cost
  34 // For example a gc_cost_ratio of 4 translates into a
  35 // throughput goal of .80
  36 
  37 AdaptiveSizePolicy::AdaptiveSizePolicy(size_t init_eden_size,
  38                                        size_t init_promo_size,
  39                                        size_t init_survivor_size,
  40                                        double gc_pause_goal_sec,
  41                                        uint gc_cost_ratio) :
  42     _eden_size(init_eden_size),
  43     _promo_size(init_promo_size),
  44     _survivor_size(init_survivor_size),
  45     _gc_pause_goal_sec(gc_pause_goal_sec),
  46     _throughput_goal(1.0 - double(1.0 / (1.0 + (double) gc_cost_ratio))),




   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  *
  23  */


  24 
  25 #include "precompiled.hpp"
  26 #include "gc_implementation/shared/adaptiveSizePolicy.hpp"
  27 #include "gc_interface/gcCause.hpp"
  28 #include "memory/collectorPolicy.hpp"
  29 #include "runtime/timer.hpp"
  30 #include "utilities/ostream.hpp"
  31 elapsedTimer AdaptiveSizePolicy::_minor_timer;
  32 elapsedTimer AdaptiveSizePolicy::_major_timer;
  33 
  34 // The throughput goal is implemented as
  35 //      _throughput_goal = 1 - ( 1 / (1 + gc_cost_ratio))
  36 // gc_cost_ratio is the ratio
  37 //      application cost / gc cost
  38 // For example a gc_cost_ratio of 4 translates into a
  39 // throughput goal of .80
  40 
  41 AdaptiveSizePolicy::AdaptiveSizePolicy(size_t init_eden_size,
  42                                        size_t init_promo_size,
  43                                        size_t init_survivor_size,
  44                                        double gc_pause_goal_sec,
  45                                        uint gc_cost_ratio) :
  46     _eden_size(init_eden_size),
  47     _promo_size(init_promo_size),
  48     _survivor_size(init_survivor_size),
  49     _gc_pause_goal_sec(gc_pause_goal_sec),
  50     _throughput_goal(1.0 - double(1.0 / (1.0 + (double) gc_cost_ratio))),