src/share/vm/gc_implementation/g1/g1RemSetSummary.hpp

Tue, 18 Mar 2014 19:07:22 +0100

author
pliden
date
Tue, 18 Mar 2014 19:07:22 +0100
changeset 6413
595c0f60d50d
parent 5812
7ec10139bf37
child 6876
710a3c8b516e
permissions
-rw-r--r--

8029075: String deduplication in G1
Summary: Implementation of JEP 192, http://openjdk.java.net/jeps/192
Reviewed-by: brutisso, tschatzl, coleenp

tschatzl@5204 1 /*
tschatzl@5204 2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
tschatzl@5204 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
tschatzl@5204 4 *
tschatzl@5204 5 * This code is free software; you can redistribute it and/or modify it
tschatzl@5204 6 * under the terms of the GNU General Public License version 2 only, as
tschatzl@5204 7 * published by the Free Software Foundation.
tschatzl@5204 8 *
tschatzl@5204 9 * This code is distributed in the hope that it will be useful, but WITHOUT
tschatzl@5204 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
tschatzl@5204 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
tschatzl@5204 12 * version 2 for more details (a copy is included in the LICENSE file that
tschatzl@5204 13 * accompanied this code).
tschatzl@5204 14 *
tschatzl@5204 15 * You should have received a copy of the GNU General Public License version
tschatzl@5204 16 * 2 along with this work; if not, write to the Free Software Foundation,
tschatzl@5204 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
tschatzl@5204 18 *
tschatzl@5204 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
tschatzl@5204 20 * or visit www.oracle.com if you need additional information or have any
tschatzl@5204 21 * questions.
tschatzl@5204 22 *
tschatzl@5204 23 */
tschatzl@5204 24
tschatzl@5204 25 #ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1REMSETSUMMARY_HPP
tschatzl@5204 26 #define SHARE_VM_GC_IMPLEMENTATION_G1_G1REMSETSUMMARY_HPP
tschatzl@5204 27
tschatzl@5204 28 #include "utilities/ostream.hpp"
tschatzl@5204 29
tschatzl@5204 30 class G1RemSet;
tschatzl@5204 31
tschatzl@5204 32 // A G1RemSetSummary manages statistical information about the G1RemSet
tschatzl@5204 33
tschatzl@5204 34 class G1RemSetSummary VALUE_OBJ_CLASS_SPEC {
tschatzl@5204 35 private:
tschatzl@5204 36 friend class GetRSThreadVTimeClosure;
tschatzl@5204 37
tschatzl@5204 38 G1RemSet* _remset;
tschatzl@5204 39
tschatzl@5204 40 G1RemSet* remset() const {
tschatzl@5204 41 return _remset;
tschatzl@5204 42 }
tschatzl@5204 43
tschatzl@5204 44 size_t _num_refined_cards;
tschatzl@5204 45 size_t _num_processed_buf_mutator;
tschatzl@5204 46 size_t _num_processed_buf_rs_threads;
tschatzl@5204 47
tschatzl@5204 48 size_t _num_coarsenings;
tschatzl@5204 49
tschatzl@5204 50 double* _rs_threads_vtimes;
tschatzl@5204 51 size_t _num_vtimes;
tschatzl@5204 52
tschatzl@5204 53 double _sampling_thread_vtime;
tschatzl@5204 54
tschatzl@5204 55 void set_rs_thread_vtime(uint thread, double value);
tschatzl@5204 56 void set_sampling_thread_vtime(double value) {
tschatzl@5204 57 _sampling_thread_vtime = value;
tschatzl@5204 58 }
tschatzl@5204 59
tschatzl@5204 60 void free_and_null() {
tschatzl@5204 61 if (_rs_threads_vtimes) {
tschatzl@5204 62 FREE_C_HEAP_ARRAY(double, _rs_threads_vtimes, mtGC);
tschatzl@5204 63 _rs_threads_vtimes = NULL;
tschatzl@5204 64 _num_vtimes = 0;
tschatzl@5204 65 }
tschatzl@5204 66 }
tschatzl@5204 67
tschatzl@5204 68 // update this summary with current data from various places
tschatzl@5204 69 void update();
tschatzl@5204 70
tschatzl@5204 71 public:
tschatzl@5204 72 G1RemSetSummary() : _remset(NULL), _num_refined_cards(0),
tschatzl@5204 73 _num_processed_buf_mutator(0), _num_processed_buf_rs_threads(0), _num_coarsenings(0),
tschatzl@5204 74 _rs_threads_vtimes(NULL), _num_vtimes(0), _sampling_thread_vtime(0.0f) {
tschatzl@5204 75 }
tschatzl@5204 76
tschatzl@5204 77 ~G1RemSetSummary() {
tschatzl@5204 78 free_and_null();
tschatzl@5204 79 }
tschatzl@5204 80
tschatzl@5204 81 // set the counters in this summary to the values of the others
tschatzl@5204 82 void set(G1RemSetSummary* other);
tschatzl@5204 83 // subtract all counters from the other summary, and set them in the current
tschatzl@5204 84 void subtract_from(G1RemSetSummary* other);
tschatzl@5204 85
tschatzl@5204 86 // initialize and get the first sampling
tschatzl@5812 87 void initialize(G1RemSet* remset);
tschatzl@5204 88
tschatzl@5204 89 void print_on(outputStream* out);
tschatzl@5204 90
tschatzl@5204 91 double rs_thread_vtime(uint thread) const;
tschatzl@5204 92
tschatzl@5204 93 double sampling_thread_vtime() const {
tschatzl@5204 94 return _sampling_thread_vtime;
tschatzl@5204 95 }
tschatzl@5204 96
tschatzl@5204 97 size_t num_concurrent_refined_cards() const {
tschatzl@5204 98 return _num_refined_cards;
tschatzl@5204 99 }
tschatzl@5204 100
tschatzl@5204 101 size_t num_processed_buf_mutator() const {
tschatzl@5204 102 return _num_processed_buf_mutator;
tschatzl@5204 103 }
tschatzl@5204 104
tschatzl@5204 105 size_t num_processed_buf_rs_threads() const {
tschatzl@5204 106 return _num_processed_buf_rs_threads;
tschatzl@5204 107 }
tschatzl@5204 108
tschatzl@5204 109 size_t num_processed_buf_total() const {
tschatzl@5204 110 return num_processed_buf_mutator() + num_processed_buf_rs_threads();
tschatzl@5204 111 }
tschatzl@5204 112
tschatzl@5204 113 size_t num_coarsenings() const {
tschatzl@5204 114 return _num_coarsenings;
tschatzl@5204 115 }
tschatzl@5204 116 };
tschatzl@5204 117
tschatzl@5204 118 #endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1REMSETSUMMARY_HPP

mercurial