8252859: Inconsistent use of alpha in class AbsSeq

Reviewed-by: tschatzl, sjohanss
This commit is contained in:
Albert Mingkun Yang 2020-09-08 11:17:09 +00:00 committed by Thomas Schatzl
parent 4fb1980fd0
commit 76002747d5
4 changed files with 6 additions and 7 deletions

View File

@ -91,8 +91,8 @@ G1AdaptiveIHOPControl::G1AdaptiveIHOPControl(double ihop_percent,
_heap_reserve_percent(heap_reserve_percent), _heap_reserve_percent(heap_reserve_percent),
_heap_waste_percent(heap_waste_percent), _heap_waste_percent(heap_waste_percent),
_predictor(predictor), _predictor(predictor),
_marking_times_s(10, 0.95), _marking_times_s(10, 0.05),
_allocation_rate_s(10, 0.95), _allocation_rate_s(10, 0.05),
_last_unrestrained_young_size(0) _last_unrestrained_young_size(0)
{ {
} }

View File

@ -1029,7 +1029,7 @@ public:
uint64_t ZStatCycle::_nwarmup_cycles = 0; uint64_t ZStatCycle::_nwarmup_cycles = 0;
Ticks ZStatCycle::_start_of_last; Ticks ZStatCycle::_start_of_last;
Ticks ZStatCycle::_end_of_last; Ticks ZStatCycle::_end_of_last;
NumberSeq ZStatCycle::_normalized_duration(0.3 /* alpha */); NumberSeq ZStatCycle::_normalized_duration(0.7 /* alpha */);
void ZStatCycle::at_start() { void ZStatCycle::at_start() {
_start_of_last = Ticks::now(); _start_of_last = Ticks::now();

View File

@ -47,11 +47,10 @@ void AbsSeq::add(double val) {
// mean := mean + incr // mean := mean + incr
// variance := (1 - alpha) * (variance + diff * incr) // variance := (1 - alpha) * (variance + diff * incr)
// PDF available at https://fanf2.user.srcf.net/hermes/doc/antiforgery/stats.pdf // PDF available at https://fanf2.user.srcf.net/hermes/doc/antiforgery/stats.pdf
// Note: alpha is actually (1.0 - _alpha) in our code
double diff = val - _davg; double diff = val - _davg;
double incr = (1.0 - _alpha) * diff; double incr = _alpha * diff;
_davg += incr; _davg += incr;
_dvariance = _alpha * (_dvariance + diff * incr); _dvariance = (1.0 - _alpha) * (_dvariance + diff * incr);
} }
} }

View File

@ -40,7 +40,7 @@
** of the sequence and calculates avg, max, and sd only over them ** of the sequence and calculates avg, max, and sd only over them
**/ **/
#define DEFAULT_ALPHA_VALUE 0.7 #define DEFAULT_ALPHA_VALUE 0.3
class AbsSeq: public CHeapObj<mtInternal> { class AbsSeq: public CHeapObj<mtInternal> {
private: private: