src/hotspot/share/gc/shared/adaptiveSizePolicy.hpp
changeset 59053 ba6c248cae19
parent 54085 ab87b06dfdc0
equal deleted inserted replaced
59051:f0312c7d5b37 59053:ba6c248cae19
    37 class elapsedTimer;
    37 class elapsedTimer;
    38 
    38 
    39 class AdaptiveSizePolicy : public CHeapObj<mtGC> {
    39 class AdaptiveSizePolicy : public CHeapObj<mtGC> {
    40  friend class GCAdaptivePolicyCounters;
    40  friend class GCAdaptivePolicyCounters;
    41  friend class PSGCAdaptivePolicyCounters;
    41  friend class PSGCAdaptivePolicyCounters;
    42  friend class CMSGCAdaptivePolicyCounters;
       
    43  protected:
    42  protected:
    44 
    43 
    45   enum GCPolicyKind {
    44   enum GCPolicyKind {
    46     _gc_adaptive_size_policy,
    45     _gc_adaptive_size_policy,
    47     _gc_ps_adaptive_size_policy,
    46     _gc_ps_adaptive_size_policy
    48     _gc_cms_adaptive_size_policy
       
    49   };
    47   };
    50   virtual GCPolicyKind kind() const { return _gc_adaptive_size_policy; }
    48   virtual GCPolicyKind kind() const { return _gc_adaptive_size_policy; }
    51 
    49 
    52   enum SizePolicyTrueValues {
    50   enum SizePolicyTrueValues {
    53     decrease_old_gen_for_throughput_true = -7,
    51     decrease_old_gen_for_throughput_true = -7,
    75   // threads run
    73   // threads run
    76   const double _throughput_goal;
    74   const double _throughput_goal;
    77 
    75 
    78   // Last calculated sizes, in bytes, and aligned
    76   // Last calculated sizes, in bytes, and aligned
    79   size_t _eden_size;        // calculated eden free space in bytes
    77   size_t _eden_size;        // calculated eden free space in bytes
    80   size_t _promo_size;       // calculated cms gen free space in bytes
    78   size_t _promo_size;       // calculated promoted free space in bytes
    81 
    79 
    82   size_t _survivor_size;    // calculated survivor size in bytes
    80   size_t _survivor_size;    // calculated survivor size in bytes
    83 
    81 
    84   // Support for UseGCOverheadLimit
    82   // Support for UseGCOverheadLimit
    85   GCOverheadChecker _overhead_checker;
    83   GCOverheadChecker _overhead_checker;
   120   LinearLeastSquareFit* _minor_pause_young_estimator;
   118   LinearLeastSquareFit* _minor_pause_young_estimator;
   121 
   119 
   122   // Variables for estimating the major and minor collection costs
   120   // Variables for estimating the major and minor collection costs
   123   //   minor collection time vs. young gen size
   121   //   minor collection time vs. young gen size
   124   LinearLeastSquareFit* _minor_collection_estimator;
   122   LinearLeastSquareFit* _minor_collection_estimator;
   125   //   major collection time vs. cms gen size
   123   //   major collection time vs. old gen size
   126   LinearLeastSquareFit* _major_collection_estimator;
   124   LinearLeastSquareFit* _major_collection_estimator;
   127 
   125 
   128   // These record the most recent collection times.  They
   126   // These record the most recent collection times.  They
   129   // are available as an alternative to using the averages
   127   // are available as an alternative to using the averages
   130   // for making ergonomic decisions.
   128   // for making ergonomic decisions.
   324                      size_t init_promo_size,
   322                      size_t init_promo_size,
   325                      size_t init_survivor_size,
   323                      size_t init_survivor_size,
   326                      double gc_pause_goal_sec,
   324                      double gc_pause_goal_sec,
   327                      uint gc_cost_ratio);
   325                      uint gc_cost_ratio);
   328 
   326 
   329   bool is_gc_cms_adaptive_size_policy() {
       
   330     return kind() == _gc_cms_adaptive_size_policy;
       
   331   }
       
   332   bool is_gc_ps_adaptive_size_policy() {
   327   bool is_gc_ps_adaptive_size_policy() {
   333     return kind() == _gc_ps_adaptive_size_policy;
   328     return kind() == _gc_ps_adaptive_size_policy;
   334   }
   329   }
   335 
   330 
   336   AdaptivePaddedAverage*   avg_minor_pause() const { return _avg_minor_pause; }
   331   AdaptivePaddedAverage*   avg_minor_pause() const { return _avg_minor_pause; }