< prev index next >

src/hotspot/share/gc/g1/g1YoungRemSetSamplingThread.cpp

Print this page
rev 56783 : [mq]: simplify


  73   // Check if load is lower than max.
  74   double recent_load;
  75   if ((G1PeriodicGCSystemLoadThreshold > 0.0f) &&
  76       (os::loadavg(&recent_load, 1) == -1 || recent_load > G1PeriodicGCSystemLoadThreshold)) {
  77     log_debug(gc, periodic)("Load %1.2f is higher than threshold %1.2f. Skipping.",
  78                             recent_load, G1PeriodicGCSystemLoadThreshold);
  79     return false;
  80   }
  81 
  82   return true;
  83 }
  84 
  85 void G1YoungRemSetSamplingThread::check_for_periodic_gc(){
  86   // If disabled, just return.
  87   if (G1PeriodicGCInterval == 0) {
  88     return;
  89   }
  90   if ((os::elapsedTime() - _last_periodic_gc_attempt_s) > (G1PeriodicGCInterval / 1000.0)) {
  91     log_debug(gc, periodic)("Checking for periodic GC.");
  92     if (should_start_periodic_gc()) {
  93       if (!G1CollectedHeap::heap()->try_collect(GCCause::_g1_periodic_collection,
  94                                                     false /* retry_on_vmop_failure */)) {
  95         log_debug(gc, periodic)("GC request denied. Skipping.");
  96       }
  97     }
  98     _last_periodic_gc_attempt_s = os::elapsedTime();
  99   }
 100 }
 101 
 102 void G1YoungRemSetSamplingThread::run_service() {
 103   double vtime_start = os::elapsedVTime();
 104 
 105   // Print a message about periodic GC configuration.
 106   if (G1PeriodicGCInterval != 0) {
 107     log_info(gc)("Periodic GC enabled with interval " UINTX_FORMAT "ms", G1PeriodicGCInterval);
 108   } else {
 109     log_info(gc)("Periodic GC disabled");
 110   }
 111 
 112   while (!should_terminate()) {
 113     sample_young_list_rs_length();
 114 




  73   // Check if load is lower than max.
  74   double recent_load;
  75   if ((G1PeriodicGCSystemLoadThreshold > 0.0f) &&
  76       (os::loadavg(&recent_load, 1) == -1 || recent_load > G1PeriodicGCSystemLoadThreshold)) {
  77     log_debug(gc, periodic)("Load %1.2f is higher than threshold %1.2f. Skipping.",
  78                             recent_load, G1PeriodicGCSystemLoadThreshold);
  79     return false;
  80   }
  81 
  82   return true;
  83 }
  84 
  85 void G1YoungRemSetSamplingThread::check_for_periodic_gc(){
  86   // If disabled, just return.
  87   if (G1PeriodicGCInterval == 0) {
  88     return;
  89   }
  90   if ((os::elapsedTime() - _last_periodic_gc_attempt_s) > (G1PeriodicGCInterval / 1000.0)) {
  91     log_debug(gc, periodic)("Checking for periodic GC.");
  92     if (should_start_periodic_gc()) {
  93       if (!G1CollectedHeap::heap()->try_collect(GCCause::_g1_periodic_collection)) {

  94         log_debug(gc, periodic)("GC request denied. Skipping.");
  95       }
  96     }
  97     _last_periodic_gc_attempt_s = os::elapsedTime();
  98   }
  99 }
 100 
 101 void G1YoungRemSetSamplingThread::run_service() {
 102   double vtime_start = os::elapsedVTime();
 103 
 104   // Print a message about periodic GC configuration.
 105   if (G1PeriodicGCInterval != 0) {
 106     log_info(gc)("Periodic GC enabled with interval " UINTX_FORMAT "ms", G1PeriodicGCInterval);
 107   } else {
 108     log_info(gc)("Periodic GC disabled");
 109   }
 110 
 111   while (!should_terminate()) {
 112     sample_young_list_rs_length();
 113 


< prev index next >