From 846590844e373dfbb96f70cb053eab3c66bc0c19 Mon Sep 17 00:00:00 2001 From: poonam Date: Wed, 17 Jun 2015 05:56:43 -0700 Subject: [PATCH] 8085965: VM hangs in C2Compiler Summary: CMSClassUnloadingEnabled and ExplicitGCInvokesConcurrentAndUnloadsClasses should be disabled when -Xnoclassgc is specified Reviewed-by: jmasa, kbarrett --- src/share/vm/memory/genMarkSweep.cpp | 2 +- src/share/vm/runtime/arguments.cpp | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/share/vm/memory/genMarkSweep.cpp b/src/share/vm/memory/genMarkSweep.cpp index ee4afdc6d..c5dc4947c 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 7a7fbe666..0ca38f1e9 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)); -- GitLab