# HG changeset patch # User jcbeyler # Date 1536167831 25200 # Node ID 11ad7d302a94423ac876eb7e1699de9a0d3abe0f # Parent 3648635050195c925f73ff14c32748b118a927bd 8208186: SetHeapSamplingInterval handles 1 explicitly Summary: Explicitly test for the 0 case (sample everything) Reviewed-by: amenkov, sspitsyn diff -r 364863505019 -r 11ad7d302a94 src/hotspot/share/runtime/threadHeapSampler.cpp --- a/src/hotspot/share/runtime/threadHeapSampler.cpp Wed Sep 05 09:12:50 2018 -0700 +++ b/src/hotspot/share/runtime/threadHeapSampler.cpp Wed Sep 05 10:17:11 2018 -0700 @@ -104,8 +104,10 @@ } void ThreadHeapSampler::pick_next_sample(size_t overflowed_bytes) { - if (get_sampling_interval() == 1) { - _bytes_until_sample = 1; + // Explicitly test if the sampling interval is 0, return 0 to sample every + // allocation. + if (get_sampling_interval() == 0) { + _bytes_until_sample = 0; return; }