< prev index next >

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

Print this page
rev 53920 : imported patch 8218880-g1-crashes-periodic-gc-gclocker


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


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




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


< prev index next >