--- old/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp Wed Jun 10 14:04:19 2015 +++ new/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp Wed Jun 10 14:04:18 2015 @@ -2671,6 +2671,10 @@ // below. void CMSCollector::update_should_unload_classes() { _should_unload_classes = false; + if (!ClassUnloading) { + return; + } + // Condition 1 above if (_full_gc_requested && ExplicitGCInvokesConcurrentAndUnloadsClasses) { _should_unload_classes = true;