src/share/vm/gc/g1/g1EvacStats.cpp
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
--- 1,7 ----
/*
! * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 44,76 ****
_direct_allocated * HeapWordSize,
_failure_used * HeapWordSize,
_failure_waste * HeapWordSize);
}
! void G1EvacStats::adjust_desired_plab_sz() {
! log_plab_allocation();
!
! if (!ResizePLAB) {
! // Clear accumulators for next round.
! reset();
! return;
! }
!
! assert(is_object_aligned(max_size()) && min_size() <= max_size(),
! "PLAB clipping computation may be incorrect");
!
! if (_allocated == 0) {
! assert((_unused == 0),
! "Inconsistency in PLAB stats: "
! "_allocated: " SIZE_FORMAT ", "
! "_wasted: " SIZE_FORMAT ", "
! "_region_end_waste: " SIZE_FORMAT ", "
! "_unused: " SIZE_FORMAT ", "
! "_used : " SIZE_FORMAT,
! _allocated, _wasted, _region_end_waste, _unused, used());
! _allocated = 1;
! }
// The size of the PLAB caps the amount of space that can be wasted at the
// end of the collection. In the worst case the last PLAB could be completely
// empty.
// This allows us to calculate the new PLAB size to achieve the
// TargetPLABWastePct given the latest memory usage and that the last buffer
--- 44,54 ----
_direct_allocated * HeapWordSize,
_failure_used * HeapWordSize,
_failure_waste * HeapWordSize);
}
! size_t G1EvacStats::compute_desired_plab_sz() {
// The size of the PLAB caps the amount of space that can be wasted at the
// end of the collection. In the worst case the last PLAB could be completely
// empty.
// This allows us to calculate the new PLAB size to achieve the
// TargetPLABWastePct given the latest memory usage and that the last buffer
*** 107,123 ****
// which is an okay reaction.
size_t const used_for_waste_calculation = used() > _region_end_waste ? used() - _region_end_waste : 0;
size_t const total_waste_allowed = used_for_waste_calculation * TargetPLABWastePct;
size_t const cur_plab_sz = (size_t)((double)total_waste_allowed / G1LastPLABAverageOccupancy);
! // Take historical weighted average
! _filter.sample(cur_plab_sz);
! _desired_net_plab_sz = MAX2(min_size(), (size_t)_filter.average());
!
! log_sizing(cur_plab_sz, _desired_net_plab_sz);
! // Clear accumulators for next round.
! reset();
}
G1EvacStats::G1EvacStats(const char* description, size_t desired_plab_sz_, unsigned wt) :
PLABStats(description, desired_plab_sz_, wt),
_region_end_waste(0),
--- 85,95 ----
// which is an okay reaction.
size_t const used_for_waste_calculation = used() > _region_end_waste ? used() - _region_end_waste : 0;
size_t const total_waste_allowed = used_for_waste_calculation * TargetPLABWastePct;
size_t const cur_plab_sz = (size_t)((double)total_waste_allowed / G1LastPLABAverageOccupancy);
! return cur_plab_sz;
}
G1EvacStats::G1EvacStats(const char* description, size_t desired_plab_sz_, unsigned wt) :
PLABStats(description, desired_plab_sz_, wt),
_region_end_waste(0),