# HG changeset patch # User ecaspole # Date 1438953342 14400 # Node ID 97d13dafd7f81d491eb7d500f399be9461930de1 # Parent acf684680d2423e974ad983080e996c7c8f4b42b 8078904: CMS: Assert failed: Ctl pt invariant Summary: Survivor rescan array now baed on MinTLABSize so all entries will fit Reviewed-by: tschatzl, kbarrett diff -r acf684680d24 -r 97d13dafd7f8 hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp --- a/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp Thu Aug 06 19:52:54 2015 +0200 +++ b/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp Fri Aug 07 09:15:42 2015 -0400 @@ -620,12 +620,12 @@ // Support for parallelizing survivor space rescan if ((CMSParallelRemarkEnabled && CMSParallelSurvivorRemarkEnabled) || CMSParallelInitialMarkEnabled) { const size_t max_plab_samples = - ((DefNewGeneration*)_young_gen)->max_survivor_size() / plab_sample_minimum_size(); + _young_gen->max_survivor_size() / (ThreadLocalAllocBuffer::min_size() * HeapWordSize); _survivor_plab_array = NEW_C_HEAP_ARRAY(ChunkArray, ParallelGCThreads, mtGC); - _survivor_chunk_array = NEW_C_HEAP_ARRAY(HeapWord*, 2*max_plab_samples, mtGC); + _survivor_chunk_array = NEW_C_HEAP_ARRAY(HeapWord*, max_plab_samples, mtGC); _cursor = NEW_C_HEAP_ARRAY(size_t, ParallelGCThreads, mtGC); - _survivor_chunk_capacity = 2*max_plab_samples; + _survivor_chunk_capacity = max_plab_samples; for (uint i = 0; i < ParallelGCThreads; i++) { HeapWord** vec = NEW_C_HEAP_ARRAY(HeapWord*, max_plab_samples, mtGC); ChunkArray* cur = ::new (&_survivor_plab_array[i]) ChunkArray(vec, max_plab_samples); @@ -641,12 +641,6 @@ _inter_sweep_timer.start(); // start of time } -size_t CMSCollector::plab_sample_minimum_size() { - // The default value of MinTLABSize is 2k, but there is - // no way to get the default value if the flag has been overridden. - return MAX2(ThreadLocalAllocBuffer::min_size() * HeapWordSize, 2 * K); -} - const char* ConcurrentMarkSweepGeneration::name() const { return "concurrent mark-sweep generation"; } diff -r acf684680d24 -r 97d13dafd7f8 hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.hpp --- a/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.hpp Thu Aug 06 19:52:54 2015 +0200 +++ b/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.hpp Fri Aug 07 09:15:42 2015 -0400 @@ -739,10 +739,6 @@ size_t* _cursor; ChunkArray* _survivor_plab_array; - // A bounded minimum size of PLABs, should not return too small values since - // this will affect the size of the data structures used for parallel young gen rescan - size_t plab_sample_minimum_size(); - // Support for marking stack overflow handling bool take_from_overflow_list(size_t num, CMSMarkStack* to_stack); bool par_take_from_overflow_list(size_t num,