src/hotspot/share/gc/z/zDirector.cpp
changeset 58701 5d10ba4a0468
parent 57660 c0a7c7161d3a
child 59148 877c000fd688
equal deleted inserted replaced
58700:f87353679927 58701:5d10ba4a0468
    46                        bytes_per_second / M,
    46                        bytes_per_second / M,
    47                        ZStatAllocRate::avg() / M,
    47                        ZStatAllocRate::avg() / M,
    48                        ZStatAllocRate::avg_sd() / M);
    48                        ZStatAllocRate::avg_sd() / M);
    49 }
    49 }
    50 
    50 
    51 bool ZDirector::is_first() const {
       
    52   return ZStatCycle::ncycles() == 0;
       
    53 }
       
    54 
       
    55 bool ZDirector::is_warm() const {
       
    56   return ZStatCycle::ncycles() >= 3;
       
    57 }
       
    58 
       
    59 bool ZDirector::rule_timer() const {
    51 bool ZDirector::rule_timer() const {
    60   if (ZCollectionInterval == 0) {
    52   if (ZCollectionInterval == 0) {
    61     // Rule disabled
    53     // Rule disabled
    62     return false;
    54     return false;
    63   }
    55   }
    71 
    63 
    72   return time_until_gc <= 0;
    64   return time_until_gc <= 0;
    73 }
    65 }
    74 
    66 
    75 bool ZDirector::rule_warmup() const {
    67 bool ZDirector::rule_warmup() const {
    76   if (is_warm()) {
    68   if (ZStatCycle::is_warm()) {
    77     // Rule disabled
    69     // Rule disabled
    78     return false;
    70     return false;
    79   }
    71   }
    80 
    72 
    81   // Perform GC if heap usage passes 10/20/30% and no other GC has been
    73   // Perform GC if heap usage passes 10/20/30% and no other GC has been
    91 
    83 
    92   return used >= used_threshold;
    84   return used >= used_threshold;
    93 }
    85 }
    94 
    86 
    95 bool ZDirector::rule_allocation_rate() const {
    87 bool ZDirector::rule_allocation_rate() const {
    96   if (is_first()) {
    88   if (ZStatCycle::is_first()) {
    97     // Rule disabled
    89     // Rule disabled
    98     return false;
    90     return false;
    99   }
    91   }
   100 
    92 
   101   // Perform GC if the estimated max allocation rate indicates that we
    93   // Perform GC if the estimated max allocation rate indicates that we
   138 
   130 
   139   return time_until_gc <= 0;
   131   return time_until_gc <= 0;
   140 }
   132 }
   141 
   133 
   142 bool ZDirector::rule_proactive() const {
   134 bool ZDirector::rule_proactive() const {
   143   if (!ZProactive || !is_warm()) {
   135   if (!ZProactive || !ZStatCycle::is_warm()) {
   144     // Rule disabled
   136     // Rule disabled
   145     return false;
   137     return false;
   146   }
   138   }
   147 
   139 
   148   // Perform GC if the impact of doing so, in terms of application throughput
   140   // Perform GC if the impact of doing so, in terms of application throughput