--- 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; --- old/src/share/vm/runtime/arguments.cpp Wed Jun 10 14:04:29 2015 +++ new/src/share/vm/runtime/arguments.cpp Wed Jun 10 14:04:27 2015 @@ -2751,6 +2751,7 @@ // -Xnoclassgc } else if (match_option(option, "-Xnoclassgc")) { FLAG_SET_CMDLINE(bool, ClassUnloading, false); + FLAG_SET_CMDLINE(bool, CMSClassUnloadingEnabled, false); // -Xconcgc } else if (match_option(option, "-Xconcgc")) { FLAG_SET_CMDLINE(bool, UseConcMarkSweepGC, true);