< prev index next >

src/hotspot/share/gc/shenandoah/heuristics/shenandoahPassiveHeuristics.cpp

Print this page




  64   return can_process_references();
  65 }
  66 
  67 bool ShenandoahPassiveHeuristics::should_unload_classes() {
  68   // Always unload classes, if we can.
  69   return can_unload_classes();
  70 }
  71 
  72 bool ShenandoahPassiveHeuristics::should_degenerate_cycle() {
  73   // Always fail to Degenerated GC, if enabled
  74   return ShenandoahDegeneratedGC;
  75 }
  76 
  77 void ShenandoahPassiveHeuristics::choose_collection_set_from_regiondata(ShenandoahCollectionSet* cset,
  78                                                                         RegionData* data, size_t size,
  79                                                                         size_t actual_free) {
  80   assert(ShenandoahDegeneratedGC, "This path is only taken for Degenerated GC");
  81 
  82   // Do not select too large CSet that would overflow the available free space.
  83   // Take at least the entire evacuation reserve, and be free to overflow to free space.
  84   size_t capacity  = ShenandoahHeap::heap()->max_capacity();
  85   size_t available = MAX2(ShenandoahEvacReserve * capacity / 100, actual_free);
  86   size_t max_cset  = (size_t)(available / ShenandoahEvacWaste);
  87 
  88   log_info(gc, ergo)("CSet Selection. Actual Free: " SIZE_FORMAT "M, Max CSet: " SIZE_FORMAT "M",
  89                      actual_free / M, max_cset / M);
  90 
  91   size_t threshold = ShenandoahHeapRegion::region_size_bytes() * ShenandoahGarbageThreshold / 100;
  92 
  93   size_t live_cset = 0;
  94   for (size_t idx = 0; idx < size; idx++) {
  95     ShenandoahHeapRegion* r = data[idx]._region;
  96     size_t new_cset = live_cset + r->get_live_data_bytes();
  97     if (new_cset < max_cset && r->garbage() > threshold) {
  98       live_cset = new_cset;
  99       cset->add_region(r);
 100     }
 101   }
 102 }
 103 
 104 const char* ShenandoahPassiveHeuristics::name() {


  64   return can_process_references();
  65 }
  66 
  67 bool ShenandoahPassiveHeuristics::should_unload_classes() {
  68   // Always unload classes, if we can.
  69   return can_unload_classes();
  70 }
  71 
  72 bool ShenandoahPassiveHeuristics::should_degenerate_cycle() {
  73   // Always fail to Degenerated GC, if enabled
  74   return ShenandoahDegeneratedGC;
  75 }
  76 
  77 void ShenandoahPassiveHeuristics::choose_collection_set_from_regiondata(ShenandoahCollectionSet* cset,
  78                                                                         RegionData* data, size_t size,
  79                                                                         size_t actual_free) {
  80   assert(ShenandoahDegeneratedGC, "This path is only taken for Degenerated GC");
  81 
  82   // Do not select too large CSet that would overflow the available free space.
  83   // Take at least the entire evacuation reserve, and be free to overflow to free space.
  84   size_t capacity  = ShenandoahHeap::heap()->capacity();
  85   size_t available = MAX2(ShenandoahEvacReserve * capacity / 100, actual_free);
  86   size_t max_cset  = (size_t)(available / ShenandoahEvacWaste);
  87 
  88   log_info(gc, ergo)("CSet Selection. Actual Free: " SIZE_FORMAT "M, Max CSet: " SIZE_FORMAT "M",
  89                      actual_free / M, max_cset / M);
  90 
  91   size_t threshold = ShenandoahHeapRegion::region_size_bytes() * ShenandoahGarbageThreshold / 100;
  92 
  93   size_t live_cset = 0;
  94   for (size_t idx = 0; idx < size; idx++) {
  95     ShenandoahHeapRegion* r = data[idx]._region;
  96     size_t new_cset = live_cset + r->get_live_data_bytes();
  97     if (new_cset < max_cset && r->garbage() > threshold) {
  98       live_cset = new_cset;
  99       cset->add_region(r);
 100     }
 101   }
 102 }
 103 
 104 const char* ShenandoahPassiveHeuristics::name() {
< prev index next >