< prev index next >

src/hotspot/share/gc/g1/g1HeapSizingPolicy.hpp

Print this page
rev 59304 : [mq]: 8245087-kim-sjohanss-review


  28 #include "memory/allocation.hpp"
  29 
  30 class G1Analytics;
  31 class G1CollectedHeap;
  32 
  33 class G1HeapSizingPolicy: public CHeapObj<mtGC> {
  34   // MinOverThresholdForGrowth must be less than the number of recorded
  35   // pause times in G1Analytics, representing the minimum number of pause
  36   // time ratios that exceed GCTimeRatio before a heap expansion will be triggered.
  37   const static uint MinOverThresholdForGrowth = 4;
  38 
  39   const G1CollectedHeap* _g1h;
  40   const G1Analytics* _analytics;
  41 
  42   const uint _num_prev_pauses_for_heuristics;
  43   // Ratio check data for determining if heap growth is necessary.
  44   uint _ratio_over_threshold_count;
  45   double _ratio_over_threshold_sum;
  46   uint _pauses_since_start;
  47 



  48 
  49 protected:
  50   G1HeapSizingPolicy(const G1CollectedHeap* g1h, const G1Analytics* analytics);
  51 public:
  52 
  53   // If an expansion would be appropriate, because recent GC overhead had
  54   // exceeded the desired limit, return an amount to expand by.
  55   virtual size_t expansion_amount();
  56 
  57   // Clear ratio tracking data used by expansion_amount().
  58   void clear_ratio_check_data();
  59 
  60   static G1HeapSizingPolicy* create(const G1CollectedHeap* g1h, const G1Analytics* analytics);
  61 };
  62 
  63 #endif // SHARE_GC_G1_G1HEAPSIZINGPOLICY_HPP


  28 #include "memory/allocation.hpp"
  29 
  30 class G1Analytics;
  31 class G1CollectedHeap;
  32 
  33 class G1HeapSizingPolicy: public CHeapObj<mtGC> {
  34   // MinOverThresholdForGrowth must be less than the number of recorded
  35   // pause times in G1Analytics, representing the minimum number of pause
  36   // time ratios that exceed GCTimeRatio before a heap expansion will be triggered.
  37   const static uint MinOverThresholdForGrowth = 4;
  38 
  39   const G1CollectedHeap* _g1h;
  40   const G1Analytics* _analytics;
  41 
  42   const uint _num_prev_pauses_for_heuristics;
  43   // Ratio check data for determining if heap growth is necessary.
  44   uint _ratio_over_threshold_count;
  45   double _ratio_over_threshold_sum;
  46   uint _pauses_since_start;
  47 
  48   // Scale "full" gc pause time threshold with heap size as we want to resize more
  49   // eagerly at small heap sizes.
  50   double scale_with_heap(double pause_time_threshold);
  51 

  52   G1HeapSizingPolicy(const G1CollectedHeap* g1h, const G1Analytics* analytics);
  53 public:
  54 
  55   // If an expansion would be appropriate, because recent GC overhead had
  56   // exceeded the desired limit, return an amount to expand by.
  57   size_t expansion_amount();
  58 
  59   // Clear ratio tracking data used by expansion_amount().
  60   void clear_ratio_check_data();
  61 
  62   static G1HeapSizingPolicy* create(const G1CollectedHeap* g1h, const G1Analytics* analytics);
  63 };
  64 
  65 #endif // SHARE_GC_G1_G1HEAPSIZINGPOLICY_HPP
< prev index next >