Skip to content

Commit

Permalink
8252859: Inconsistent use of alpha in class AbsSeq
Browse files Browse the repository at this point in the history
Reviewed-by: tschatzl, sjohanss
  • Loading branch information
albertnetymk authored and Thomas Schatzl committed Sep 8, 2020
1 parent 4fb1980 commit 7600274
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/hotspot/share/gc/g1/g1IHOPControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ G1AdaptiveIHOPControl::G1AdaptiveIHOPControl(double ihop_percent,
_heap_reserve_percent(heap_reserve_percent),
_heap_waste_percent(heap_waste_percent),
_predictor(predictor),
_marking_times_s(10, 0.95),
_allocation_rate_s(10, 0.95),
_marking_times_s(10, 0.05),
_allocation_rate_s(10, 0.05),
_last_unrestrained_young_size(0)
{
}
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/gc/z/zStat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1029,7 +1029,7 @@ class ZStatTablePrinter {
uint64_t ZStatCycle::_nwarmup_cycles = 0;
Ticks ZStatCycle::_start_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() {
_start_of_last = Ticks::now();
Expand Down
5 changes: 2 additions & 3 deletions src/hotspot/share/utilities/numberSeq.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,10 @@ void AbsSeq::add(double val) {
// mean := mean + incr
// variance := (1 - alpha) * (variance + diff * incr)
// 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 incr = (1.0 - _alpha) * diff;
double incr = _alpha * diff;
_davg += incr;
_dvariance = _alpha * (_dvariance + diff * incr);
_dvariance = (1.0 - _alpha) * (_dvariance + diff * incr);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/utilities/numberSeq.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
** 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> {
private:
Expand Down

1 comment on commit 7600274

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented on 7600274 Sep 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review

Issues

Please sign in to comment.