--- old/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp Wed Feb 20 16:22:02 2013 +++ new/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp Wed Feb 20 16:22:01 2013 @@ -267,8 +267,22 @@ double max_gc_time = (double) MaxGCPauseMillis / 1000.0; double time_slice = (double) GCPauseIntervalMillis / 1000.0; _mmu_tracker = new G1MMUTrackerQueue(time_slice, max_gc_time); - _sigma = (double) G1ConfidencePercent / 100.0; + intx confidence_perc = G1ConfidencePercent; + // Put an artificial ceiling on this so that it's not set to a silly value. + if (confidence_perc > 100) { + confidence_perc = 100; + warning("G1ConfidencePercent is set to a value that is too large, " + "it's been updated to %u", confidence_perc); + } + // Put an artificial flooring on this so that it's not set to a silly value. + if (confidence_perc < 0) { + confidence_perc = 0; + warning("G1ConfidencePercent is set to a value that is too small, " + "it's been updated to %u", confidence_perc); + } + _sigma = (double) confidence_perc / 100.0; + // start conservatively (around 50ms is about right) _concurrent_mark_remark_times_ms->add(0.05); _concurrent_mark_cleanup_times_ms->add(0.20);