8215548: G1PeriodicGCSystemLoadThreshold needs to be a double
Summary: Change G1PeriodicGCSystemLoadThreshold to be a double to allow better granularity in determining idleness
Reviewed-by: sjohanss, sangheki
--- a/src/hotspot/share/gc/g1/g1YoungRemSetSamplingThread.cpp Thu Dec 20 17:07:07 2018 +0000
+++ b/src/hotspot/share/gc/g1/g1YoungRemSetSamplingThread.cpp Thu Dec 20 19:44:33 2018 +0100
@@ -71,9 +71,9 @@
// Check if load is lower than max.
double recent_load;
- if ((G1PeriodicGCSystemLoadThreshold > 0) &&
+ if ((G1PeriodicGCSystemLoadThreshold > 0.0f) &&
(os::loadavg(&recent_load, 1) == -1 || recent_load > G1PeriodicGCSystemLoadThreshold)) {
- log_debug(gc, periodic)("Load %1.2f is higher than threshold " UINTX_FORMAT ". Skipping.",
+ log_debug(gc, periodic)("Load %1.2f is higher than threshold %1.2f. Skipping.",
recent_load, G1PeriodicGCSystemLoadThreshold);
return false;
}
--- a/src/hotspot/share/gc/g1/g1_globals.hpp Thu Dec 20 17:07:07 2018 +0000
+++ b/src/hotspot/share/gc/g1/g1_globals.hpp Thu Dec 20 19:44:33 2018 +0100
@@ -311,10 +311,11 @@
"perform a concurrent GC as periodic GC, otherwise use a STW " \
"Full GC.") \
\
- manageable(uintx, G1PeriodicGCSystemLoadThreshold, 0, \
- "Maximum recent system wide system load as returned by the 1m " \
- "value of getloadavg() at which G1 triggers a periodic GC. A " \
- "load above this value cancels a given periodic GC. A value of " \
- "zero disables this check.") \
+ manageable(double, G1PeriodicGCSystemLoadThreshold, 0.0, \
+ "Maximum recent system wide load as returned by the 1m value " \
+ "of getloadavg() at which G1 triggers a periodic GC. A load " \
+ "above this value cancels a given periodic GC. A value of zero " \
+ "disables this check.") \
+ range(0.0, (double)max_uintx) \
#endif // SHARE_VM_GC_G1_G1_GLOBALS_HPP