--- a/src/hotspot/share/runtime/threadHeapSampler.cpp Tue Jul 17 17:52:03 2018 -0700
+++ b/src/hotspot/share/runtime/threadHeapSampler.cpp Tue Jul 17 19:59:38 2018 -0700
@@ -31,7 +31,7 @@
// Cheap random number generator
uint64_t ThreadHeapSampler::_rnd;
// Default is 512kb.
-int ThreadHeapSampler::_sampling_rate = 512 * 1024;
+int ThreadHeapSampler::_sampling_interval = 512 * 1024;
int ThreadHeapSampler::_enabled;
// Statics for the fast log
@@ -69,7 +69,7 @@
// Generates a geometric variable with the specified mean (512K by default).
// This is done by generating a random number between 0 and 1 and applying
// the inverse cumulative distribution function for an exponential.
-// Specifically: Let m be the inverse of the sample rate, then
+// Specifically: Let m be the inverse of the sample interval, then
// the probability distribution function is m*exp(-mx) so the CDF is
// p = 1 - exp(-mx), so
// q = 1 - p = exp(-mx)
@@ -96,14 +96,14 @@
// negative answer.
double log_val = (fast_log2(q) - 26);
double result =
- (0.0 < log_val ? 0.0 : log_val) * (-log(2.0) * (get_sampling_rate())) + 1;
+ (0.0 < log_val ? 0.0 : log_val) * (-log(2.0) * (get_sampling_interval())) + 1;
assert(result > 0 && result < SIZE_MAX, "Result is not in an acceptable range.");
- size_t rate = static_cast<size_t>(result);
- _bytes_until_sample = rate;
+ size_t interval = static_cast<size_t>(result);
+ _bytes_until_sample = interval;
}
void ThreadHeapSampler::pick_next_sample(size_t overflowed_bytes) {
- if (get_sampling_rate() == 1) {
+ if (get_sampling_interval() == 1) {
_bytes_until_sample = 1;
return;
}
@@ -161,12 +161,12 @@
OrderAccess::release_store(&_enabled, 0);
}
-int ThreadHeapSampler::get_sampling_rate() {
- return OrderAccess::load_acquire(&_sampling_rate);
+int ThreadHeapSampler::get_sampling_interval() {
+ return OrderAccess::load_acquire(&_sampling_interval);
}
-void ThreadHeapSampler::set_sampling_rate(int sampling_rate) {
- OrderAccess::release_store(&_sampling_rate, sampling_rate);
+void ThreadHeapSampler::set_sampling_interval(int sampling_interval) {
+ OrderAccess::release_store(&_sampling_interval, sampling_interval);
}
// Methods used in assertion mode to check if a collector is present or not at