/* * Copyright (c) 2018, 2022, 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. *
*/
// Per-Region statistics gathered during marking. // // This includes // * the number of live words gathered during marking for the area from bottom // to tams. This is an exact measure. // The code corrects later for the live data between tams and top. struct G1RegionMarkStats {
size_t _live_words;
// Clear all members. void clear() {
_live_words = 0;
} // Clear all members after a marking overflow. Nothing to do as the live words // are updated by the atomic mark. We do not remark objects after overflow. void clear_during_overflow() {
}
// Per-marking thread cache for the region mark statistics. // // Each cache is a larg'ish map of region-idx -> G1RegionMarkStats entries that cache // currently gathered statistics; entries are evicted to the global statistics array // on every collision. This minimizes synchronization overhead which would be required // every time statistics change, as marking is very localized. // The map entry number is a power of two to allow simple and fast hashing using // logical and. class G1RegionMarkStatsCache { private: // The array of statistics entries to evict to; the global array.
G1RegionMarkStats* _target;
// An entry of the statistics cache. struct G1RegionMarkStatsCacheEntry {
uint _region_idx;
G1RegionMarkStats _stats;
G1RegionMarkStatsCacheEntry* find_for_add(uint region_idx); public: // Number of entries in the per-task stats entry. This value seems enough // to have a very low cache miss rate. staticconst uint RegionMarkStatsCacheSize = 1024;
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.