diff --git a/src/share/vm/memory/genMarkSweep.cpp b/src/share/vm/memory/genMarkSweep.cpp index ee4afdc6d7742739dac73d6c497442d11a9fe55a..c5dc4947c282174134fbe98918de579b237c67bb 100644 --- a/src/share/vm/memory/genMarkSweep.cpp +++ b/src/share/vm/memory/genMarkSweep.cpp @@ -211,7 +211,7 @@ void GenMarkSweep::mark_sweep_phase1(int level, false, // Younger gens are not roots. true, // activate StrongRootsScope GenCollectedHeap::SO_None, - GenCollectedHeap::StrongRootsOnly, + ClassUnloading, &follow_root_closure, &follow_root_closure, &follow_cld_closure); diff --git a/src/share/vm/runtime/arguments.cpp b/src/share/vm/runtime/arguments.cpp index 7a7fbe666ed81d398cf45a3759b3ab7b4b7dc2eb..0ca38f1e9948c2878c0280f8a12d9322f5c1a784 100644 --- a/src/share/vm/runtime/arguments.cpp +++ b/src/share/vm/runtime/arguments.cpp @@ -1372,6 +1372,12 @@ void Arguments::set_cms_and_parnew_gc_flags() { if (!FLAG_IS_DEFAULT(CMSParPromoteBlocksToClaim) || !FLAG_IS_DEFAULT(OldPLABWeight)) { CFLS_LAB::modify_initialization(OldPLABSize, OldPLABWeight); } + + if (!ClassUnloading) { + FLAG_SET_CMDLINE(bool, CMSClassUnloadingEnabled, false); + FLAG_SET_CMDLINE(bool, ExplicitGCInvokesConcurrentAndUnloadsClasses, false); + } + if (PrintGCDetails && Verbose) { tty->print_cr("MarkStackSize: %uk MarkStackSizeMax: %uk", (unsigned int) (MarkStackSize / K), (uint) (MarkStackSizeMax / K));