Skip to content

Commit 3b8a2f8

Browse files
author
Thomas Schatzl
committed
8337269: G1ConfidencePercent interpreted inconsistently
Reviewed-by: kbarrett, iwalulya
1 parent 521effe commit 3b8a2f8

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

src/hotspot/share/gc/g1/g1Policy.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
#include "gc/shared/gcTraceTime.inline.hpp"
5454

5555
G1Policy::G1Policy(STWGCTimer* gc_timer) :
56-
_predictor(G1ConfidencePercent / 100.0),
56+
_predictor((100 - G1ConfidencePercent) / 100.0),
5757
_analytics(new G1Analytics(&_predictor)),
5858
_remset_tracker(),
5959
_mmu_tracker(new G1MMUTracker(GCPauseIntervalMillis / 1000.0, MaxGCPauseMillis / 1000.0)),

src/hotspot/share/gc/g1/g1Predictions.hpp

+8-9
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@
2929

3030
// Utility class containing various helper methods for prediction.
3131
class G1Predictions {
32-
private:
33-
double _sigma;
32+
private:
33+
// Scale factor indicating to which degree stddev should be taking into account in predictions.
34+
double _stddev_scale;
3435

3536
// This function is used to estimate the stddev of sample sets. There is some
3637
// special consideration of small sample sets: the actual stddev for them is
@@ -46,16 +47,14 @@ class G1Predictions {
4647
}
4748
return estimate;
4849
}
49-
public:
50-
G1Predictions(double sigma) : _sigma(sigma) {
51-
assert(sigma >= 0.0, "Confidence must be larger than or equal to zero");
52-
}
5350

54-
// Confidence factor.
55-
double sigma() const { return _sigma; }
51+
public:
52+
G1Predictions(double stddev_scale) : _stddev_scale(stddev_scale) {
53+
assert(stddev_scale >= 0.0, "must be");
54+
}
5655

5756
double predict(TruncatedSeq const* seq) const {
58-
return seq->davg() + _sigma * stddev_estimate(seq);
57+
return seq->davg() + _stddev_scale * stddev_estimate(seq);
5958
}
6059

6160
double predict_in_unit_interval(TruncatedSeq const* seq) const {

src/hotspot/share/gc/g1/g1_globals.hpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@
111111
range(1, max_intx) \
112112
\
113113
product(uint, G1ConfidencePercent, 50, \
114-
"Confidence level for MMU/pause predictions") \
114+
"Confidence level for MMU/pause predictions. A higher value " \
115+
"means that G1 will use less safety margin for its predictions.") \
115116
range(1, 100) \
116117
\
117118
product(uintx, G1SummarizeRSetStatsPeriod, 0, DIAGNOSTIC, \

0 commit comments

Comments
 (0)