< prev index next >

hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp

Print this page
rev 6887 : 8060467: CMS: small OldPLABSize and -XX:-ResizePLAB cause assert(ResizePLAB || n_blks == OldPLABSize) failed: Error
Reviewed-by: tschatzl, jmasa, kbarrett


2624       // If it didn't work, give up.
2625       if (fl->count() == 0) return NULL;
2626     }
2627     res = fl->get_chunk_at_head();
2628     assert(res != NULL, "Why was count non-zero?");
2629   }
2630   res->markNotFree();
2631   assert(!res->is_free(), "shouldn't be marked free");
2632   assert(oop(res)->klass_or_null() == NULL, "should look uninitialized");
2633   // mangle a just allocated object with a distinct pattern.
2634   debug_only(res->mangleAllocated(word_sz));
2635   return (HeapWord*)res;
2636 }
2637 
2638 // Get a chunk of blocks of the right size and update related
2639 // book-keeping stats
2640 void CFLS_LAB::get_from_global_pool(size_t word_sz, AdaptiveFreeList<FreeChunk>* fl) {
2641   // Get the #blocks we want to claim
2642   size_t n_blks = (size_t)_blocks_to_claim[word_sz].average();
2643   assert(n_blks > 0, "Error");
2644   assert(ResizePLAB || n_blks == OldPLABSize, "Error");
2645   // In some cases, when the application has a phase change,
2646   // there may be a sudden and sharp shift in the object survival
2647   // profile, and updating the counts at the end of a scavenge
2648   // may not be quick enough, giving rise to large scavenge pauses
2649   // during these phase changes. It is beneficial to detect such
2650   // changes on-the-fly during a scavenge and avoid such a phase-change
2651   // pothole. The following code is a heuristic attempt to do that.
2652   // It is protected by a product flag until we have gained
2653   // enough experience with this heuristic and fine-tuned its behaviour.
2654   // WARNING: This might increase fragmentation if we overreact to
2655   // small spikes, so some kind of historical smoothing based on
2656   // previous experience with the greater reactivity might be useful.
2657   // Lacking sufficient experience, CMSOldPLABResizeQuicker is disabled by
2658   // default.
2659   if (ResizeOldPLAB && CMSOldPLABResizeQuicker) {
2660     size_t multiple = _num_blocks[word_sz]/(CMSOldPLABToleranceFactor*CMSOldPLABNumRefills*n_blks);
2661     n_blks +=  CMSOldPLABReactivityFactor*multiple*n_blks;
2662     n_blks = MIN2(n_blks, CMSOldPLABMax);
2663   }
2664   assert(n_blks > 0, "Error");




2624       // If it didn't work, give up.
2625       if (fl->count() == 0) return NULL;
2626     }
2627     res = fl->get_chunk_at_head();
2628     assert(res != NULL, "Why was count non-zero?");
2629   }
2630   res->markNotFree();
2631   assert(!res->is_free(), "shouldn't be marked free");
2632   assert(oop(res)->klass_or_null() == NULL, "should look uninitialized");
2633   // mangle a just allocated object with a distinct pattern.
2634   debug_only(res->mangleAllocated(word_sz));
2635   return (HeapWord*)res;
2636 }
2637 
2638 // Get a chunk of blocks of the right size and update related
2639 // book-keeping stats
2640 void CFLS_LAB::get_from_global_pool(size_t word_sz, AdaptiveFreeList<FreeChunk>* fl) {
2641   // Get the #blocks we want to claim
2642   size_t n_blks = (size_t)_blocks_to_claim[word_sz].average();
2643   assert(n_blks > 0, "Error");
2644   assert(ResizeOldPLAB || n_blks == OldPLABSize, "Error");
2645   // In some cases, when the application has a phase change,
2646   // there may be a sudden and sharp shift in the object survival
2647   // profile, and updating the counts at the end of a scavenge
2648   // may not be quick enough, giving rise to large scavenge pauses
2649   // during these phase changes. It is beneficial to detect such
2650   // changes on-the-fly during a scavenge and avoid such a phase-change
2651   // pothole. The following code is a heuristic attempt to do that.
2652   // It is protected by a product flag until we have gained
2653   // enough experience with this heuristic and fine-tuned its behaviour.
2654   // WARNING: This might increase fragmentation if we overreact to
2655   // small spikes, so some kind of historical smoothing based on
2656   // previous experience with the greater reactivity might be useful.
2657   // Lacking sufficient experience, CMSOldPLABResizeQuicker is disabled by
2658   // default.
2659   if (ResizeOldPLAB && CMSOldPLABResizeQuicker) {
2660     size_t multiple = _num_blocks[word_sz]/(CMSOldPLABToleranceFactor*CMSOldPLABNumRefills*n_blks);
2661     n_blks +=  CMSOldPLABReactivityFactor*multiple*n_blks;
2662     n_blks = MIN2(n_blks, CMSOldPLABMax);
2663   }
2664   assert(n_blks > 0, "Error");


< prev index next >