< prev index next >
src/share/vm/gc_implementation/shared/parGCAllocBuffer.cpp
Print this page
@@ -37,11 +37,11 @@
return ThreadLocalAllocBuffer::max_size();
}
ParGCAllocBuffer::ParGCAllocBuffer(size_t desired_plab_sz_) :
_word_sz(desired_plab_sz_), _bottom(NULL), _top(NULL),
- _end(NULL), _hard_end(NULL), _allocated(0), _wasted(0)
+ _end(NULL), _hard_end(NULL), _allocated(0), _wasted(0), _undo_wasted(0)
{
// ArrayOopDesc::header_size depends on command line initialization.
AlignmentReserve = oopDesc::header_size() > MinObjAlignment ? align_object_size(arrayOopDesc::header_size(T_INT)) : 0;
assert(min_size() > AlignmentReserve,
err_msg("Minimum PLAB size " SIZE_FORMAT" must be larger than alignment reserve " SIZE_FORMAT" "
@@ -60,17 +60,19 @@
size_t unused = retire_internal();
// Now flush the statistics.
stats->add_allocated(_allocated);
stats->add_wasted(_wasted);
+ stats->add_undo_wasted(_undo_wasted);
stats->add_unused(unused);
// Since we have flushed the stats we need to clear the _allocated and _wasted
// fields in case somebody retains an instance of this over GCs. Not doing so
// will artifically inflate the values in the statistics.
_allocated = 0;
_wasted = 0;
+ _undo_wasted = 0;
}
void ParGCAllocBuffer::retire() {
_wasted += retire_internal();
}
@@ -96,12 +98,13 @@
if (_allocated == 0) {
assert(_unused == 0,
err_msg("Inconsistency in PLAB stats: "
"_allocated: "SIZE_FORMAT", "
"_wasted: "SIZE_FORMAT", "
- "_unused: "SIZE_FORMAT,
- _allocated, _wasted, _unused));
+ "_unused: "SIZE_FORMAT", ",
+ "_undo_wasted: "SIZE_FORMAT,
+ _allocated, _wasted, _unused, _undo_wasted,));
_allocated = 1;
}
double wasted_frac = (double)_unused / (double)_allocated;
size_t target_refills = (size_t)((wasted_frac * TargetSurvivorRatio) / TargetPLABWastePct);
< prev index next >