comparison src/share/vm/gc_implementation/shared/parGCAllocBuffer.cpp @ 6756:b2ef234911c9

7190666: G1: assert(_unused == 0) failed: Inconsistency in PLAB stats Summary: Reset the fields in ParGCAllocBuffer, that are used for accumulating values for the ResizePLAB sensors in PLABStats, to zero after flushing the values to the PLABStats fields. Flush PLABStats values only when retiring the final allocation buffers prior to disposing of a G1ParScanThreadState object, rather than when retiring every allocation buffer. Reviewed-by: jwilhelm, jmasa, ysr
author johnc
date Thu, 20 Sep 2012 09:52:56 -0700
parents aaf61e68b255
children 2e6857353b2c
comparison
equal deleted inserted replaced
6755:bc675e55b48c 6756:b2ef234911c9
88 // use. This should be called once at the end of parallel 88 // use. This should be called once at the end of parallel
89 // scavenge; it clears the sensor accumulators. 89 // scavenge; it clears the sensor accumulators.
90 void PLABStats::adjust_desired_plab_sz() { 90 void PLABStats::adjust_desired_plab_sz() {
91 assert(ResizePLAB, "Not set"); 91 assert(ResizePLAB, "Not set");
92 if (_allocated == 0) { 92 if (_allocated == 0) {
93 assert(_unused == 0, "Inconsistency in PLAB stats"); 93 assert(_unused == 0,
94 err_msg("Inconsistency in PLAB stats: "
95 "_allocated: "SIZE_FORMAT", "
96 "_wasted: "SIZE_FORMAT", "
97 "_unused: "SIZE_FORMAT", "
98 "_used : "SIZE_FORMAT,
99 _allocated, _wasted, _unused, _used));
100
94 _allocated = 1; 101 _allocated = 1;
95 } 102 }
96 double wasted_frac = (double)_unused/(double)_allocated; 103 double wasted_frac = (double)_unused/(double)_allocated;
97 size_t target_refills = (size_t)((wasted_frac*TargetSurvivorRatio)/ 104 size_t target_refills = (size_t)((wasted_frac*TargetSurvivorRatio)/
98 TargetPLABWastePct); 105 TargetPLABWastePct);