< prev index next >

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

Print this page




  30 #include "logging/logTag.hpp"
  31 #include "runtime/os.hpp"
  32 
  33 ShenandoahAggressiveHeuristics::ShenandoahAggressiveHeuristics() : ShenandoahHeuristics() {
  34   // Do not shortcut evacuation
  35   SHENANDOAH_ERGO_OVERRIDE_DEFAULT(ShenandoahImmediateThreshold, 100);
  36 
  37   // Aggressive runs with max speed for allocation, to capture races against mutator
  38   SHENANDOAH_ERGO_DISABLE_FLAG(ShenandoahPacing);
  39 
  40   // Aggressive evacuates everything, so it needs as much evac space as it can get
  41   SHENANDOAH_ERGO_ENABLE_FLAG(ShenandoahEvacReserveOverflow);
  42 
  43   // If class unloading is globally enabled, aggressive does unloading even with
  44   // concurrent cycles.
  45   if (ClassUnloading) {
  46     SHENANDOAH_ERGO_OVERRIDE_DEFAULT(ShenandoahUnloadClassesFrequency, 1);
  47   }
  48 
  49   // Final configuration checks

  50   SHENANDOAH_CHECK_FLAG_SET(ShenandoahSATBBarrier);
  51   SHENANDOAH_CHECK_FLAG_SET(ShenandoahReadBarrier);
  52   SHENANDOAH_CHECK_FLAG_SET(ShenandoahWriteBarrier);
  53   SHENANDOAH_CHECK_FLAG_SET(ShenandoahStoreValReadBarrier);
  54   SHENANDOAH_CHECK_FLAG_SET(ShenandoahKeepAliveBarrier);
  55   SHENANDOAH_CHECK_FLAG_SET(ShenandoahCASBarrier);
  56   SHENANDOAH_CHECK_FLAG_SET(ShenandoahAcmpBarrier);
  57   SHENANDOAH_CHECK_FLAG_SET(ShenandoahCloneBarrier);
  58 }
  59 
  60 void ShenandoahAggressiveHeuristics::choose_collection_set_from_regiondata(ShenandoahCollectionSet* cset,
  61                                                                            RegionData* data, size_t size,
  62                                                                            size_t free) {
  63   for (size_t idx = 0; idx < size; idx++) {
  64     ShenandoahHeapRegion* r = data[idx]._region;
  65     if (r->garbage() > 0) {
  66       cset->add_region(r);
  67     }
  68   }
  69 }
  70 
  71 bool ShenandoahAggressiveHeuristics::should_start_normal_gc() const {
  72   log_info(gc)("Trigger: Start next cycle immediately");
  73   return true;
  74 }
  75 
  76 bool ShenandoahAggressiveHeuristics::should_process_references() {




  30 #include "logging/logTag.hpp"
  31 #include "runtime/os.hpp"
  32 
  33 ShenandoahAggressiveHeuristics::ShenandoahAggressiveHeuristics() : ShenandoahHeuristics() {
  34   // Do not shortcut evacuation
  35   SHENANDOAH_ERGO_OVERRIDE_DEFAULT(ShenandoahImmediateThreshold, 100);
  36 
  37   // Aggressive runs with max speed for allocation, to capture races against mutator
  38   SHENANDOAH_ERGO_DISABLE_FLAG(ShenandoahPacing);
  39 
  40   // Aggressive evacuates everything, so it needs as much evac space as it can get
  41   SHENANDOAH_ERGO_ENABLE_FLAG(ShenandoahEvacReserveOverflow);
  42 
  43   // If class unloading is globally enabled, aggressive does unloading even with
  44   // concurrent cycles.
  45   if (ClassUnloading) {
  46     SHENANDOAH_ERGO_OVERRIDE_DEFAULT(ShenandoahUnloadClassesFrequency, 1);
  47   }
  48 
  49   // Final configuration checks
  50   SHENANDOAH_CHECK_FLAG_SET(ShenandoahLoadRefBarrier);
  51   SHENANDOAH_CHECK_FLAG_SET(ShenandoahSATBBarrier);



  52   SHENANDOAH_CHECK_FLAG_SET(ShenandoahKeepAliveBarrier);
  53   SHENANDOAH_CHECK_FLAG_SET(ShenandoahCASBarrier);

  54   SHENANDOAH_CHECK_FLAG_SET(ShenandoahCloneBarrier);
  55 }
  56 
  57 void ShenandoahAggressiveHeuristics::choose_collection_set_from_regiondata(ShenandoahCollectionSet* cset,
  58                                                                            RegionData* data, size_t size,
  59                                                                            size_t free) {
  60   for (size_t idx = 0; idx < size; idx++) {
  61     ShenandoahHeapRegion* r = data[idx]._region;
  62     if (r->garbage() > 0) {
  63       cset->add_region(r);
  64     }
  65   }
  66 }
  67 
  68 bool ShenandoahAggressiveHeuristics::should_start_normal_gc() const {
  69   log_info(gc)("Trigger: Start next cycle immediately");
  70   return true;
  71 }
  72 
  73 bool ShenandoahAggressiveHeuristics::should_process_references() {


< prev index next >