< prev index next >

src/hotspot/share/gc/shared/adaptiveSizePolicy.hpp

Print this page




  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_GC_SHARED_ADAPTIVESIZEPOLICY_HPP
  26 #define SHARE_VM_GC_SHARED_ADAPTIVESIZEPOLICY_HPP
  27 
  28 #include "gc/shared/collectedHeap.hpp"
  29 #include "gc/shared/gcCause.hpp"
  30 #include "gc/shared/gcUtil.hpp"
  31 #include "logging/log.hpp"
  32 #include "memory/allocation.hpp"
  33 #include "memory/universe.hpp"
  34 
  35 // This class keeps statistical information and computes the
  36 // size of the heap.
  37 
  38 // Forward decls
  39 class elapsedTimer;
  40 class CollectorPolicy;
  41 
  42 class AdaptiveSizePolicy : public CHeapObj<mtGC> {
  43  friend class GCAdaptivePolicyCounters;
  44  friend class PSGCAdaptivePolicyCounters;
  45  friend class CMSGCAdaptivePolicyCounters;
  46  protected:
  47 
  48   enum GCPolicyKind {
  49     _gc_adaptive_size_policy,
  50     _gc_ps_adaptive_size_policy,
  51     _gc_cms_adaptive_size_policy
  52   };
  53   virtual GCPolicyKind kind() const { return _gc_adaptive_size_policy; }
  54 
  55   enum SizePolicyTrueValues {
  56     decrease_old_gen_for_throughput_true = -7,
  57     decrease_young_gen_for_througput_true = -6,
  58 
  59     increase_old_gen_for_min_pauses_true = -5,
  60     decrease_old_gen_for_min_pauses_true = -4,


 469 
 470   int change_young_gen_for_min_pauses() const {
 471     return _change_young_gen_for_min_pauses;
 472   }
 473   void set_change_young_gen_for_min_pauses(int v) {
 474     _change_young_gen_for_min_pauses = v;
 475   }
 476   void set_decrease_for_footprint(int v) { _decrease_for_footprint = v; }
 477   int decrease_for_footprint() const { return _decrease_for_footprint; }
 478   int decide_at_full_gc() { return _decide_at_full_gc; }
 479   void set_decide_at_full_gc(int v) { _decide_at_full_gc = v; }
 480 
 481   // Check the conditions for an out-of-memory due to excessive GC time.
 482   // Set _gc_overhead_limit_exceeded if all the conditions have been met.
 483   void check_gc_overhead_limit(size_t young_live,
 484                                size_t eden_live,
 485                                size_t max_old_gen_size,
 486                                size_t max_eden_size,
 487                                bool   is_full_gc,
 488                                GCCause::Cause gc_cause,
 489                                CollectorPolicy* collector_policy);
 490 
 491   static bool should_update_promo_stats(GCCause::Cause cause) {
 492     return ((GCCause::is_user_requested_gc(cause)  &&
 493                UseAdaptiveSizePolicyWithSystemGC) ||
 494             GCCause::is_tenured_allocation_failure_gc(cause));
 495   }
 496 
 497   static bool should_update_eden_stats(GCCause::Cause cause) {
 498     return ((GCCause::is_user_requested_gc(cause)  &&
 499                UseAdaptiveSizePolicyWithSystemGC) ||
 500             GCCause::is_allocation_failure_gc(cause));
 501   }
 502 
 503   // Printing support
 504   virtual bool print() const;
 505   void print_tenuring_threshold(uint new_tenuring_threshold) const;
 506 };
 507 
 508 #endif // SHARE_VM_GC_SHARED_ADAPTIVESIZEPOLICY_HPP


  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_GC_SHARED_ADAPTIVESIZEPOLICY_HPP
  26 #define SHARE_VM_GC_SHARED_ADAPTIVESIZEPOLICY_HPP
  27 
  28 #include "gc/shared/collectedHeap.hpp"
  29 #include "gc/shared/gcCause.hpp"
  30 #include "gc/shared/gcUtil.hpp"
  31 #include "logging/log.hpp"
  32 #include "memory/allocation.hpp"
  33 #include "memory/universe.hpp"
  34 
  35 // This class keeps statistical information and computes the
  36 // size of the heap.
  37 
  38 // Forward decls
  39 class elapsedTimer;
  40 class SoftRefPolicy;
  41 
  42 class AdaptiveSizePolicy : public CHeapObj<mtGC> {
  43  friend class GCAdaptivePolicyCounters;
  44  friend class PSGCAdaptivePolicyCounters;
  45  friend class CMSGCAdaptivePolicyCounters;
  46  protected:
  47 
  48   enum GCPolicyKind {
  49     _gc_adaptive_size_policy,
  50     _gc_ps_adaptive_size_policy,
  51     _gc_cms_adaptive_size_policy
  52   };
  53   virtual GCPolicyKind kind() const { return _gc_adaptive_size_policy; }
  54 
  55   enum SizePolicyTrueValues {
  56     decrease_old_gen_for_throughput_true = -7,
  57     decrease_young_gen_for_througput_true = -6,
  58 
  59     increase_old_gen_for_min_pauses_true = -5,
  60     decrease_old_gen_for_min_pauses_true = -4,


 469 
 470   int change_young_gen_for_min_pauses() const {
 471     return _change_young_gen_for_min_pauses;
 472   }
 473   void set_change_young_gen_for_min_pauses(int v) {
 474     _change_young_gen_for_min_pauses = v;
 475   }
 476   void set_decrease_for_footprint(int v) { _decrease_for_footprint = v; }
 477   int decrease_for_footprint() const { return _decrease_for_footprint; }
 478   int decide_at_full_gc() { return _decide_at_full_gc; }
 479   void set_decide_at_full_gc(int v) { _decide_at_full_gc = v; }
 480 
 481   // Check the conditions for an out-of-memory due to excessive GC time.
 482   // Set _gc_overhead_limit_exceeded if all the conditions have been met.
 483   void check_gc_overhead_limit(size_t young_live,
 484                                size_t eden_live,
 485                                size_t max_old_gen_size,
 486                                size_t max_eden_size,
 487                                bool   is_full_gc,
 488                                GCCause::Cause gc_cause,
 489                                SoftRefPolicy* soft_ref_policy);
 490 
 491   static bool should_update_promo_stats(GCCause::Cause cause) {
 492     return ((GCCause::is_user_requested_gc(cause)  &&
 493                UseAdaptiveSizePolicyWithSystemGC) ||
 494             GCCause::is_tenured_allocation_failure_gc(cause));
 495   }
 496 
 497   static bool should_update_eden_stats(GCCause::Cause cause) {
 498     return ((GCCause::is_user_requested_gc(cause)  &&
 499                UseAdaptiveSizePolicyWithSystemGC) ||
 500             GCCause::is_allocation_failure_gc(cause));
 501   }
 502 
 503   // Printing support
 504   virtual bool print() const;
 505   void print_tenuring_threshold(uint new_tenuring_threshold) const;
 506 };
 507 
 508 #endif // SHARE_VM_GC_SHARED_ADAPTIVESIZEPOLICY_HPP
< prev index next >