diff src/share/vm/gc_implementation/shared/vmGCOperations.cpp @ 20282:f3aeae1f9fc5

8048269: Add flag to turn off class unloading after G1 concurrent mark Summary: Added -XX:+/-ClassUnloadingWithConcurrentMark Reviewed-by: jmasa, brutisso, mgerdin
author stefank
date Wed, 06 Aug 2014 09:55:16 +0200
parents bac98749fe00
children 7848fc12602b af8f16ac392c
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/shared/vmGCOperations.cpp	Mon Aug 04 15:04:45 2014 +0200
+++ b/src/share/vm/gc_implementation/shared/vmGCOperations.cpp	Wed Aug 06 09:55:16 2014 +0200
@@ -209,6 +209,7 @@
   gch->do_full_collection(gch->must_clear_all_soft_refs(), _max_level);
 }
 
+// Returns true iff concurrent GCs unloads metadata.
 bool VM_CollectForMetadataAllocation::initiate_concurrent_GC() {
 #if INCLUDE_ALL_GCS
   if (UseConcMarkSweepGC && CMSClassUnloadingEnabled) {
@@ -216,7 +217,7 @@
     return true;
   }
 
-  if (UseG1GC) {
+  if (UseG1GC && ClassUnloadingWithConcurrentMark) {
     G1CollectedHeap* g1h = G1CollectedHeap::heap();
     g1h->g1_policy()->set_initiate_conc_mark_if_possible();