src/share/vm/gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.cpp

Print this page


   1 /*
   2  * Copyright (c) 2004, 2006, 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  *
  23  */
  24 #include "incls/_precompiled.incl"
  25 #include "incls/_cmsAdaptiveSizePolicy.cpp.incl"
  26 















  27 elapsedTimer CMSAdaptiveSizePolicy::_concurrent_timer;
  28 elapsedTimer CMSAdaptiveSizePolicy::_STW_timer;
  29 
  30 // Defined if the granularity of the time measurements is potentially too large.
  31 #define CLOCK_GRANULARITY_TOO_LARGE
  32 
  33 CMSAdaptiveSizePolicy::CMSAdaptiveSizePolicy(size_t init_eden_size,
  34                                              size_t init_promo_size,
  35                                              size_t init_survivor_size,
  36                                              double max_gc_minor_pause_sec,
  37                                              double max_gc_pause_sec,
  38                                              uint gc_cost_ratio) :
  39   AdaptiveSizePolicy(init_eden_size,
  40                      init_promo_size,
  41                      init_survivor_size,
  42                      max_gc_pause_sec,
  43                      gc_cost_ratio) {
  44 
  45   clear_internal_time_intervals();
  46 


   1 /*
   2  * Copyright (c) 2004, 2010, 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  *
  23  */


  24 
  25 #include "precompiled.hpp"
  26 #include "gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.hpp"
  27 #include "gc_implementation/shared/gcStats.hpp"
  28 #include "memory/defNewGeneration.hpp"
  29 #include "memory/genCollectedHeap.hpp"
  30 #include "runtime/thread.hpp"
  31 #ifdef TARGET_OS_FAMILY_linux
  32 # include "os_linux.inline.hpp"
  33 #endif
  34 #ifdef TARGET_OS_FAMILY_solaris
  35 # include "os_solaris.inline.hpp"
  36 #endif
  37 #ifdef TARGET_OS_FAMILY_windows
  38 # include "os_windows.inline.hpp"
  39 #endif
  40 elapsedTimer CMSAdaptiveSizePolicy::_concurrent_timer;
  41 elapsedTimer CMSAdaptiveSizePolicy::_STW_timer;
  42 
  43 // Defined if the granularity of the time measurements is potentially too large.
  44 #define CLOCK_GRANULARITY_TOO_LARGE
  45 
  46 CMSAdaptiveSizePolicy::CMSAdaptiveSizePolicy(size_t init_eden_size,
  47                                              size_t init_promo_size,
  48                                              size_t init_survivor_size,
  49                                              double max_gc_minor_pause_sec,
  50                                              double max_gc_pause_sec,
  51                                              uint gc_cost_ratio) :
  52   AdaptiveSizePolicy(init_eden_size,
  53                      init_promo_size,
  54                      init_survivor_size,
  55                      max_gc_pause_sec,
  56                      gc_cost_ratio) {
  57 
  58   clear_internal_time_intervals();
  59