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); |