From 24a4a151f67e5b1d5fbd903a7c1fc94a91d96cb8 Mon Sep 17 00:00:00 2001 From: poonam Date: Mon, 6 Jul 2015 06:48:11 -0700 Subject: [PATCH] 8129108: nmethod related crash in CMS Summary: Add SO_AllCodeCache to root scanning options when not unloading classes with a CMS collection cycle Reviewed-by: mgerdin, jwilhelm --- .../concurrentMarkSweep/concurrentMarkSweepGeneration.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp index 917a62f9f..de5555fb7 100644 --- a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp @@ -3339,9 +3339,11 @@ void CMSCollector::setup_cms_unloading_and_verification_state() { // Not unloading classes this cycle assert(!should_unload_classes(), "Inconsitency!"); + // If we are not unloading classes then add SO_AllCodeCache to root + // scanning options. + add_root_scanning_option(rso); + if ((!verifying() || unloaded_classes_last_cycle()) && should_verify) { - // Include symbols, strings and code cache elements to prevent their resurrection. - add_root_scanning_option(rso); set_verifying(true); } else if (verifying() && !should_verify) { // We were verifying, but some verification flags got disabled. -- GitLab