/* * Copyright (c) 2001, 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. *
*/
// Two major user controls over G1 behavior are setting a pause // time goal (MaxGCPauseMillis), over a time slice (GCPauseIntervalMillis). // This defines the Minimum Mutator Utilisation (MMU) goal. // // * Definitions * // Mutator Utilisation: // - for a given time slice duration "ts", // - mutator utilisation is the following fraction: // non_gc_time / ts // // Minimum Mutator Utilisation (MMU): // - the worst mutator utilisation across all time slices. // // The G1MMUTracker uses a fixed-size queue to keep track of all // recent pause times. The pause time data is used to avoid // breaking the MMU. // // ***** ALL TIMES ARE IN SECS!!!!!!! ***** class G1MMUTracker: public CHeapObj<mtGC> { private: enum PrivateConstants {
QueueLength = 64
};
double _time_slice; double _max_gc_time; // this is per time slice
// The array keeps track of all the pauses that fall within a time // slice (the last time slice during which pauses took place). // The data structure implemented is a circular queue. // Head "points" to the most recent addition, tail to the oldest one. // The array is of fixed size and I don't think we'll need more than // two or three entries with the current behavior of G1 pauses. // If the array is full, an easy fix is to look for the pauses with // the shortest gap between them and consolidate them. // For now, we have taken the expedient alternative of forgetting // the oldest entry, thus potentially violating MMU specs for // some time thereafter.
G1MMUTrackerElem _array[QueueLength]; int _head_index; int _tail_index; int _no_entries;
void remove_expired_entries(double current_time); // Returns the amount of time spent in gc pauses in the time slice before the // given timestamp. double calculate_gc_time(double current_timestamp); public:
G1MMUTracker(double time_slice, double max_gc_time);
void add_pause(double start, double end);
// Minimum delay required from current_timestamp until a GC pause of duration // pause_time may be scheduled without violating the MMU constraint. double when_sec(double current_timestamp, double pause_time);
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.