8085965: VM hangs in C2Compiler
Summary: CMSClassUnloadingEnabled and ExplicitGCInvokesConcurrentAndUnloadsClasses should be disabled when -Xnoclassgc is specified
Reviewed-by: jmasa, kbarrett
--- a/hotspot/src/share/vm/gc/serial/genMarkSweep.cpp Wed Jun 10 07:37:11 2015 +0200
+++ b/hotspot/src/share/vm/gc/serial/genMarkSweep.cpp Tue Jun 16 14:30:27 2015 -0700
@@ -208,7 +208,7 @@
level,
false, // Younger gens are not roots.
GenCollectedHeap::SO_None,
- GenCollectedHeap::StrongRootsOnly,
+ ClassUnloading,
&follow_root_closure,
&follow_root_closure,
&follow_cld_closure);
--- a/hotspot/src/share/vm/runtime/arguments.cpp Wed Jun 10 07:37:11 2015 +0200
+++ b/hotspot/src/share/vm/runtime/arguments.cpp Tue Jun 16 14:30:27 2015 -0700
@@ -1384,6 +1384,12 @@
if (!FLAG_IS_DEFAULT(OldPLABSize) || !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));