< prev index next >

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

Print this page
rev 8068 : 6407976: GC worker number should be unsigned
Reviewed-by: jwilhelm
   1 /*
   2  * Copyright (c) 2004, 2012, 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  *


 326   }
 327   bool decrement_tenuring_threshold_for_survivor_limit() const {
 328     return _decrement_tenuring_threshold_for_survivor_limit;
 329   }
 330   void set_decrement_tenuring_threshold_for_survivor_limit(bool v) {
 331     _decrement_tenuring_threshold_for_survivor_limit = v;
 332   }
 333   // Return true if the policy suggested a change.
 334   bool tenuring_threshold_change() const;
 335 
 336   static bool _debug_perturbation;
 337 
 338  public:
 339   AdaptiveSizePolicy(size_t init_eden_size,
 340                      size_t init_promo_size,
 341                      size_t init_survivor_size,
 342                      double gc_pause_goal_sec,
 343                      uint gc_cost_ratio);
 344 
 345   // Return number default  GC threads to use in the next GC.
 346   static int calc_default_active_workers(uintx total_workers,
 347                                          const uintx min_workers,
 348                                          uintx active_workers,
 349                                          uintx application_workers);
 350 
 351   // Return number of GC threads to use in the next GC.
 352   // This is called sparingly so as not to change the
 353   // number of GC workers gratuitously.
 354   //   For ParNew collections
 355   //   For PS scavenge and ParOld collections
 356   //   For G1 evacuation pauses (subject to update)
 357   // Other collection phases inherit the number of
 358   // GC workers from the calls above.  For example,
 359   // a CMS parallel remark uses the same number of GC
 360   // workers as the most recent ParNew collection.
 361   static int calc_active_workers(uintx total_workers,
 362                                  uintx active_workers,
 363                                  uintx application_workers);
 364 
 365   // Return number of GC threads to use in the next concurrent GC phase.
 366   static int calc_active_conc_workers(uintx total_workers,
 367                                       uintx active_workers,
 368                                       uintx application_workers);
 369 
 370   bool is_gc_cms_adaptive_size_policy() {
 371     return kind() == _gc_cms_adaptive_size_policy;
 372   }
 373   bool is_gc_ps_adaptive_size_policy() {
 374     return kind() == _gc_ps_adaptive_size_policy;
 375   }
 376 
 377   AdaptivePaddedAverage*   avg_minor_pause() const { return _avg_minor_pause; }
 378   AdaptiveWeightedAverage* avg_minor_interval() const {
 379     return _avg_minor_interval;
 380   }
 381   AdaptiveWeightedAverage* avg_minor_gc_cost() const {
 382     return _avg_minor_gc_cost;
 383   }
 384 
 385   AdaptiveWeightedAverage* avg_major_gc_cost() const {
 386     return _avg_major_gc_cost;


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


 326   }
 327   bool decrement_tenuring_threshold_for_survivor_limit() const {
 328     return _decrement_tenuring_threshold_for_survivor_limit;
 329   }
 330   void set_decrement_tenuring_threshold_for_survivor_limit(bool v) {
 331     _decrement_tenuring_threshold_for_survivor_limit = v;
 332   }
 333   // Return true if the policy suggested a change.
 334   bool tenuring_threshold_change() const;
 335 
 336   static bool _debug_perturbation;
 337 
 338  public:
 339   AdaptiveSizePolicy(size_t init_eden_size,
 340                      size_t init_promo_size,
 341                      size_t init_survivor_size,
 342                      double gc_pause_goal_sec,
 343                      uint gc_cost_ratio);
 344 
 345   // Return number default  GC threads to use in the next GC.
 346   static uint calc_default_active_workers(uintx total_workers,
 347                                          const uintx min_workers,
 348                                          uintx active_workers,
 349                                          uintx application_workers);
 350 
 351   // Return number of GC threads to use in the next GC.
 352   // This is called sparingly so as not to change the
 353   // number of GC workers gratuitously.
 354   //   For ParNew collections
 355   //   For PS scavenge and ParOld collections
 356   //   For G1 evacuation pauses (subject to update)
 357   // Other collection phases inherit the number of
 358   // GC workers from the calls above.  For example,
 359   // a CMS parallel remark uses the same number of GC
 360   // workers as the most recent ParNew collection.
 361   static uint calc_active_workers(uintx total_workers,
 362                                  uintx active_workers,
 363                                  uintx application_workers);
 364 
 365   // Return number of GC threads to use in the next concurrent GC phase.
 366   static uint calc_active_conc_workers(uintx total_workers,
 367                                       uintx active_workers,
 368                                       uintx application_workers);
 369 
 370   bool is_gc_cms_adaptive_size_policy() {
 371     return kind() == _gc_cms_adaptive_size_policy;
 372   }
 373   bool is_gc_ps_adaptive_size_policy() {
 374     return kind() == _gc_ps_adaptive_size_policy;
 375   }
 376 
 377   AdaptivePaddedAverage*   avg_minor_pause() const { return _avg_minor_pause; }
 378   AdaptiveWeightedAverage* avg_minor_interval() const {
 379     return _avg_minor_interval;
 380   }
 381   AdaptiveWeightedAverage* avg_minor_gc_cost() const {
 382     return _avg_minor_gc_cost;
 383   }
 384 
 385   AdaptiveWeightedAverage* avg_major_gc_cost() const {
 386     return _avg_major_gc_cost;


< prev index next >