src/share/vm/gc_implementation/shared/gcUtil.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Cdiff src/share/vm/gc_implementation/shared/gcUtil.cpp

src/share/vm/gc_implementation/shared/gcUtil.cpp

Print this page

        

*** 29,41 **** float AdaptiveWeightedAverage::compute_adaptive_average(float new_sample, float average) { // We smooth the samples by not using weight() directly until we've // had enough data to make it meaningful. We'd like the first weight ! // used to be 1, the second to be 1/2, etc until we have 100/weight ! // samples. ! unsigned count_weight = 100/count(); unsigned adaptive_weight = (MAX2(weight(), count_weight)); float new_avg = exp_avg(average, new_sample, adaptive_weight); return new_avg; --- 29,47 ---- float AdaptiveWeightedAverage::compute_adaptive_average(float new_sample, float average) { // We smooth the samples by not using weight() directly until we've // had enough data to make it meaningful. We'd like the first weight ! // used to be 1, the second to be 1/2, etc until we have ! // OLD_THRESHOLD/weight samples. ! unsigned count_weight = 0; ! ! // Avoid division by zero if the counter wraps (7158457) ! if (!is_old()) { ! count_weight = OLD_THRESHOLD/count(); ! } ! unsigned adaptive_weight = (MAX2(weight(), count_weight)); float new_avg = exp_avg(average, new_sample, adaptive_weight); return new_avg;
src/share/vm/gc_implementation/shared/gcUtil.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File