--- old/src/share/vm/gc/g1/g1CollectedHeap.cpp 2015-06-06 02:21:43.000000000 +0200 +++ new/src/share/vm/gc/g1/g1CollectedHeap.cpp 2015-06-06 02:21:43.000000000 +0200 @@ -4373,7 +4373,7 @@ // We also need to mark copied objects. strong_root_cl = &scan_mark_root_cl; strong_cld_cl = &scan_mark_cld_cl; - if (ClassUnloadingWithConcurrentMark) { + if (ClassUnloading && ClassUnloadingWithConcurrentMark) { weak_root_cl = &scan_mark_weak_root_cl; weak_cld_cl = &scan_mark_weak_cld_cl; trace_metadata = true; @@ -4706,12 +4706,14 @@ public: void clean_klass(InstanceKlass* ik) { - ik->clean_implementors_list(_is_alive); - ik->clean_method_data(_is_alive); - - // G1 specific cleanup work that has - // been moved here to be done in parallel. - ik->clean_dependent_nmethods(); + if (ClassUnloading) { + ik->clean_implementors_list(_is_alive); + ik->clean_method_data(_is_alive); + + // G1 specific cleanup work that has + // been moved here to be done in parallel. + ik->clean_dependent_nmethods(); + } } void work() {