< prev index next >

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

Print this page
@@ -29,10 +29,13 @@
  #include "gc/shenandoah/shenandoahHeap.inline.hpp"
  #include "gc/shenandoah/shenandoahHeapRegion.inline.hpp"
  #include "logging/log.hpp"
  #include "logging/logTag.hpp"
  
+ ShenandoahPassiveHeuristics::ShenandoahPassiveHeuristics(ShenandoahSpaceInfo* space_info) :
+   ShenandoahHeuristics(space_info) {}
+ 
  bool ShenandoahPassiveHeuristics::should_start_gc() {
    // Never do concurrent GCs.
    return false;
  }
  

@@ -51,11 +54,11 @@
                                                                          size_t actual_free) {
    assert(ShenandoahDegeneratedGC, "This path is only taken for Degenerated GC");
  
    // Do not select too large CSet that would overflow the available free space.
    // Take at least the entire evacuation reserve, and be free to overflow to free space.
-   size_t max_capacity = ShenandoahHeap::heap()->max_capacity();
+   size_t max_capacity = _space_info->max_capacity();
    size_t available = MAX2(max_capacity / 100 * ShenandoahEvacReserve, actual_free);
    size_t max_cset  = (size_t)(available / ShenandoahEvacWaste);
  
    log_info(gc, ergo)("CSet Selection. Actual Free: " SIZE_FORMAT "%s, Max CSet: " SIZE_FORMAT "%s",
                       byte_size_in_proper_unit(actual_free), proper_unit_for_byte_size(actual_free),

@@ -63,11 +66,11 @@
  
    size_t threshold = ShenandoahHeapRegion::region_size_bytes() * ShenandoahGarbageThreshold / 100;
  
    size_t live_cset = 0;
    for (size_t idx = 0; idx < size; idx++) {
-     ShenandoahHeapRegion* r = data[idx]._region;
+     ShenandoahHeapRegion* r = data[idx].get_region();
      size_t new_cset = live_cset + r->get_live_data_bytes();
      if (new_cset < max_cset && r->garbage() > threshold) {
        live_cset = new_cset;
        cset->add_region(r);
      }
< prev index next >