--- old/src/share/vm/memory/defNewGeneration.cpp 2015-05-13 14:03:42.137417633 +0200 +++ new/src/share/vm/memory/defNewGeneration.cpp 2015-05-13 14:03:42.009413378 +0200 @@ -39,6 +39,7 @@ #include "memory/iterator.hpp" #include "memory/referencePolicy.hpp" #include "memory/space.inline.hpp" +#include "memory/strongRootsScope.hpp" #include "oops/instanceRefKlass.hpp" #include "oops/oop.inline.hpp" #include "runtime/atomic.inline.hpp" @@ -625,15 +626,20 @@ assert(gch->no_allocs_since_save_marks(0), "save marks have not been newly set."); - gch->gen_process_roots(_level, - true, // Process younger gens, if any, - // as strong roots. - true, // activate StrongRootsScope - GenCollectedHeap::SO_ScavengeCodeCache, - GenCollectedHeap::StrongAndWeakRoots, - &fsc_with_no_gc_barrier, - &fsc_with_gc_barrier, - &cld_scan_closure); + { + // SerialGC runs with n_workers == 0. + StrongRootsScope srs(0); + + gch->gen_process_roots(&srs, + _level, + true, // Process younger gens, if any, + // as strong roots. + GenCollectedHeap::SO_ScavengeCodeCache, + GenCollectedHeap::StrongAndWeakRoots, + &fsc_with_no_gc_barrier, + &fsc_with_gc_barrier, + &cld_scan_closure); + } // "evacuate followers". evacuate_followers.do_void();