--- old/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp 2014-12-12 02:18:53.846000000 -0500 +++ new/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp 2014-12-12 02:18:53.739000000 -0500 @@ -1608,14 +1608,13 @@ // If the collection is being acquired from the background // collector, there may be references on the discovered - // references lists that have NULL referents (being those - // that were concurrently cleared by a mutator) or - // that are no longer active (having been enqueued concurrently - // by the mutator). - // Scrub the list of those references because Mark-Sweep-Compact - // code assumes referents are not NULL and that all discovered - // Reference objects are active. - ref_processor()->clean_up_discovered_references(); + // references lists. Abandon those references, since some + // of them may have become unreachable due to later mutator + // activity, and the compacting collector we're about to run + // won't see them as live. + ref_processor()->disable_discovery(); + ref_processor()->abandon_partial_discovery(); + ref_processor()->verify_no_references_recorded(); if (first_state > Idling) { save_heap_summary(); @@ -1681,7 +1680,7 @@ ReferenceProcessorMTDiscoveryMutator rp_mut_discovery(ref_processor(), false); ref_processor()->set_enqueuing_is_done(false); - ref_processor()->enable_discovery(false /*verify_disabled*/, false /*check_no_refs*/); + ref_processor()->enable_discovery(); ref_processor()->setup_policy(clear_all_soft_refs); // If an asynchronous collection finishes, the _modUnionTable is // all clear. If we are assuming the collection from an asynchronous @@ -2998,7 +2997,7 @@ Mutex::_no_safepoint_check_flag); checkpointRootsInitialWork(); // enable ("weak") refs discovery - rp->enable_discovery(true /*verify_disabled*/, true /*check_no_refs*/); + rp->enable_discovery(); _collectorState = Marking; } SpecializationStats::print();