< prev index next >

src/hotspot/share/gc/z/zDirector.cpp

Print this page

        

*** 47,71 **** ZStatAllocRate::avg() / M, ZStatAllocRate::avg_sd() / M); } bool ZDirector::is_first() const { ! return ZStatPhaseCycle::ncycles() == 0; } bool ZDirector::is_warm() const { ! return ZStatPhaseCycle::ncycles() >= 3; } bool ZDirector::rule_timer() const { if (ZCollectionInterval == 0) { // Rule disabled return false; } // Perform GC if timer has expired. ! const double time_since_last_gc = ZStatPhaseCycle::time_since_last(); const double time_until_gc = ZCollectionInterval - time_since_last_gc; log_debug(gc, director)("Rule: Timer, Interval: %us, TimeUntilGC: %.3lfs", ZCollectionInterval, time_until_gc); --- 47,71 ---- ZStatAllocRate::avg() / M, ZStatAllocRate::avg_sd() / M); } bool ZDirector::is_first() const { ! return ZStatCycle::ncycles() == 0; } bool ZDirector::is_warm() const { ! return ZStatCycle::ncycles() >= 3; } bool ZDirector::rule_timer() const { if (ZCollectionInterval == 0) { // Rule disabled return false; } // Perform GC if timer has expired. ! const double time_since_last_gc = ZStatCycle::time_since_last(); const double time_until_gc = ZCollectionInterval - time_since_last_gc; log_debug(gc, director)("Rule: Timer, Interval: %us, TimeUntilGC: %.3lfs", ZCollectionInterval, time_until_gc);
*** 81,91 **** // Perform GC if heap usage passes 10/20/30% and no other GC has been // performed yet. This allows us to get some early samples of the GC // duration, which is needed by the other rules. const size_t max_capacity = ZHeap::heap()->max_capacity(); const size_t used = ZHeap::heap()->used(); ! const double used_threshold_percent = (ZStatPhaseCycle::ncycles() + 1) * 0.1; const size_t used_threshold = max_capacity * used_threshold_percent; log_debug(gc, director)("Rule: Warmup %.0f%%, Used: " SIZE_FORMAT "MB, UsedThreshold: " SIZE_FORMAT "MB", used_threshold_percent * 100, used / M, used_threshold / M); --- 81,91 ---- // Perform GC if heap usage passes 10/20/30% and no other GC has been // performed yet. This allows us to get some early samples of the GC // duration, which is needed by the other rules. const size_t max_capacity = ZHeap::heap()->max_capacity(); const size_t used = ZHeap::heap()->used(); ! const double used_threshold_percent = (ZStatCycle::ncycles() + 1) * 0.1; const size_t used_threshold = max_capacity * used_threshold_percent; log_debug(gc, director)("Rule: Warmup %.0f%%, Used: " SIZE_FORMAT "MB, UsedThreshold: " SIZE_FORMAT "MB", used_threshold_percent * 100, used / M, used_threshold / M);
*** 122,132 **** const double max_alloc_rate = (ZStatAllocRate::avg() * ZAllocationSpikeTolerance) + (ZStatAllocRate::avg_sd() * one_in_1000); const double time_until_oom = free / (max_alloc_rate + 1.0); // Plus 1.0B/s to avoid division by zero // Calculate max duration of a GC cycle. The duration of GC is a moving // average, we add ~3.3 sigma to account for the GC duration variance. ! const AbsSeq& duration_of_gc = ZStatPhaseCycle::duration(); const double max_duration_of_gc = duration_of_gc.davg() + (duration_of_gc.dsd() * one_in_1000); // Calculate time until GC given the time until OOM and max duration of GC. // We also deduct the sample interval, so that we don't overshoot the target // time and end up starting the GC too late in the next interval. --- 122,132 ---- const double max_alloc_rate = (ZStatAllocRate::avg() * ZAllocationSpikeTolerance) + (ZStatAllocRate::avg_sd() * one_in_1000); const double time_until_oom = free / (max_alloc_rate + 1.0); // Plus 1.0B/s to avoid division by zero // Calculate max duration of a GC cycle. The duration of GC is a moving // average, we add ~3.3 sigma to account for the GC duration variance. ! const AbsSeq& duration_of_gc = ZStatCycle::duration(); const double max_duration_of_gc = duration_of_gc.davg() + (duration_of_gc.dsd() * one_in_1000); // Calculate time until GC given the time until OOM and max duration of GC. // We also deduct the sample interval, so that we don't overshoot the target // time and end up starting the GC too late in the next interval.
*** 156,175 **** // applications with very low allocation rate. const size_t used_after_last_gc = ZStatHeap::used_at_relocate_end(); const size_t used_increase_threshold = ZHeap::heap()->max_capacity() * 0.10; // 10% const size_t used_threshold = used_after_last_gc + used_increase_threshold; const size_t used = ZHeap::heap()->used(); ! const double time_since_last_gc = ZStatPhaseCycle::time_since_last(); const double time_since_last_gc_threshold = 5 * 60; // 5 minutes if (used < used_threshold && time_since_last_gc < time_since_last_gc_threshold) { // Don't even consider doing a proactive GC return false; } const double assumed_throughput_drop_during_gc = 0.50; // 50% const double acceptable_throughput_drop = 0.01; // 1% ! const AbsSeq& duration_of_gc = ZStatPhaseCycle::duration(); const double max_duration_of_gc = duration_of_gc.davg() + (duration_of_gc.dsd() * one_in_1000); const double acceptable_gc_interval = max_duration_of_gc * ((assumed_throughput_drop_during_gc / acceptable_throughput_drop) - 1.0); const double time_until_gc = acceptable_gc_interval - time_since_last_gc; log_debug(gc, director)("Rule: Proactive, AcceptableGCInterval: %.3lfs, TimeSinceLastGC: %.3lfs, TimeUntilGC: %.3lfs", --- 156,175 ---- // applications with very low allocation rate. const size_t used_after_last_gc = ZStatHeap::used_at_relocate_end(); const size_t used_increase_threshold = ZHeap::heap()->max_capacity() * 0.10; // 10% const size_t used_threshold = used_after_last_gc + used_increase_threshold; const size_t used = ZHeap::heap()->used(); ! const double time_since_last_gc = ZStatCycle::time_since_last(); const double time_since_last_gc_threshold = 5 * 60; // 5 minutes if (used < used_threshold && time_since_last_gc < time_since_last_gc_threshold) { // Don't even consider doing a proactive GC return false; } const double assumed_throughput_drop_during_gc = 0.50; // 50% const double acceptable_throughput_drop = 0.01; // 1% ! const AbsSeq& duration_of_gc = ZStatCycle::duration(); const double max_duration_of_gc = duration_of_gc.davg() + (duration_of_gc.dsd() * one_in_1000); const double acceptable_gc_interval = max_duration_of_gc * ((assumed_throughput_drop_during_gc / acceptable_throughput_drop) - 1.0); const double time_until_gc = acceptable_gc_interval - time_since_last_gc; log_debug(gc, director)("Rule: Proactive, AcceptableGCInterval: %.3lfs, TimeSinceLastGC: %.3lfs, TimeUntilGC: %.3lfs",
< prev index next >