8152180: SIGFPE in CMSCollector::preclean with big CMSScheduleRemarkSamplingRatio
authorsangheki
Thu, 07 Apr 2016 15:33:25 -0700
changeset 37432 4a57933cebfa
parent 37431 7f1d6f206102
child 37433 f8fd0bcc60af
8152180: SIGFPE in CMSCollector::preclean with big CMSScheduleRemarkSamplingRatio Summary: Rephrased the calculation routine to avoid an overflow for CMSScheduleRemarkSamplingRatio Reviewed-by: jwilhelm, drwhite
hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp
--- a/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp	Thu Apr 07 21:24:12 2016 +0000
+++ b/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp	Thu Apr 07 15:33:25 2016 -0700
@@ -3598,7 +3598,7 @@
     size_t capacity = get_eden_capacity();
     // Don't start sampling unless we will get sufficiently
     // many samples.
-    if (used < (capacity/(CMSScheduleRemarkSamplingRatio * 100)
+    if (used < (((capacity / CMSScheduleRemarkSamplingRatio) / 100)
                 * CMSScheduleRemarkEdenPenetration)) {
       _start_sampling = true;
     } else {