Print this page
G1: Use SoftMaxHeapSize to guide GC heuristics

Split Close
Expand all
Collapse all
          --- old/src/hotspot/share/gc/g1/g1HeapSizingPolicy.hpp
          +++ new/src/hotspot/share/gc/g1/g1HeapSizingPolicy.hpp
↓ open down ↓ 37 lines elided ↑ open up ↑
  38   38  
  39   39    const G1CollectedHeap* _g1h;
  40   40    const G1Analytics* _analytics;
  41   41  
  42   42    const uint _num_prev_pauses_for_heuristics;
  43   43    // Ratio check data for determining if heap growth is necessary.
  44   44    uint _ratio_over_threshold_count;
  45   45    double _ratio_over_threshold_sum;
  46   46    uint _pauses_since_start;
  47   47  
       48 +  // Mininum heap capacity after last concurrent mark
       49 +  size_t _minimum_desired_bytes_after_last_cm;
       50 +
  48   51  
  49   52  protected:
  50   53    G1HeapSizingPolicy(const G1CollectedHeap* g1h, const G1Analytics* analytics);
  51   54  public:
  52   55  
  53   56    // If an expansion would be appropriate, because recent GC overhead had
  54   57    // exceeded the desired limit, return an amount to expand by.
  55      -  virtual size_t expansion_amount();
       58 +  virtual size_t expansion_amount_after_young_collection();
       59 +  virtual size_t expansion_amount_after_concurrent_mark();
       60 +  virtual size_t shrink_amount_after_mixed_collections();
  56   61  
       62 +  // Calculate the target capacity based on used bytes and free ratio
       63 +  virtual size_t target_heap_capacity(size_t used_bytes,  uintx free_ratio);
  57   64    // Clear ratio tracking data used by expansion_amount().
  58   65    void clear_ratio_check_data();
  59   66  
  60   67    static G1HeapSizingPolicy* create(const G1CollectedHeap* g1h, const G1Analytics* analytics);
  61   68  };
  62   69  
  63   70  #endif // SHARE_GC_G1_G1HEAPSIZINGPOLICY_HPP
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX