/* * Copyright (c) 2015, 2020, 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. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. *
*/
G1IHOPControl::G1IHOPControl(double initial_ihop_percent,
G1OldGenAllocationTracker const* old_gen_alloc_tracker) :
_initial_ihop_percent(initial_ihop_percent),
_target_occupancy(0),
_last_allocation_time_s(0.0),
_old_gen_alloc_tracker(old_gen_alloc_tracker)
{
assert(_initial_ihop_percent >= 0.0 && _initial_ihop_percent <= 100.0, "Initial IHOP value must be between 0 and 100 but is %.3f", initial_ihop_percent);
}
void G1IHOPControl::update_allocation_info(double allocation_time_s, size_t additional_buffer_size) {
assert(allocation_time_s >= 0.0, "Allocation time must be positive but is %.3f", allocation_time_s);
size_t G1AdaptiveIHOPControl::actual_target_threshold() const {
guarantee(_target_occupancy > 0, "Target occupancy still not updated yet."); // The actual target threshold takes the heap reserve and the expected waste in // free space into account. // _heap_reserve is that part of the total heap capacity that is reserved for // eventual promotion failure. // _heap_waste is the amount of space will never be reclaimed in any // heap, so can not be used for allocation during marking and must always be // considered.
size_t predicted_needed_bytes_during_marking =
pred_promotion_size + // In reality we would need the maximum size of the young gen during // marking. This is a conservative estimate.
_last_unrestrained_young_size;
double G1AdaptiveIHOPControl::last_mutator_period_old_allocation_rate() const {
assert(_last_allocation_time_s > 0, "This should not be called when the last GC is full");
void G1AdaptiveIHOPControl::update_marking_length(double marking_length_s) {
assert(marking_length_s >= 0.0, "Marking length must be larger than zero but is %.3f", marking_length_s);
_marking_times_s.add(marking_length_s);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.