src/share/vm/gc_implementation/parallelScavenge/psGCAdaptivePolicyCounters.hpp

Thu, 27 May 2010 19:08:38 -0700

author
trims
date
Thu, 27 May 2010 19:08:38 -0700
changeset 1907
c18cbe5936b8
parent 1822
0bfd3fb24150
child 2314
f95d63e2154a
permissions
-rw-r--r--

6941466: Oracle rebranding changes for Hotspot repositories
Summary: Change all the Sun copyrights to Oracle copyright
Reviewed-by: ohair

duke@435 1 /*
trims@1907 2 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
duke@435 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@435 4 *
duke@435 5 * This code is free software; you can redistribute it and/or modify it
duke@435 6 * under the terms of the GNU General Public License version 2 only, as
duke@435 7 * published by the Free Software Foundation.
duke@435 8 *
duke@435 9 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@435 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@435 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@435 12 * version 2 for more details (a copy is included in the LICENSE file that
duke@435 13 * accompanied this code).
duke@435 14 *
duke@435 15 * You should have received a copy of the GNU General Public License version
duke@435 16 * 2 along with this work; if not, write to the Free Software Foundation,
duke@435 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@435 18 *
trims@1907 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@1907 20 * or visit www.oracle.com if you need additional information or have any
trims@1907 21 * questions.
duke@435 22 *
duke@435 23 */
duke@435 24
duke@435 25 // PSGCAdaptivePolicyCounters is a holder class for performance counters
duke@435 26 // that track the data and decisions for the ergonomics policy for the
duke@435 27 // parallel scavenge collector.
duke@435 28
duke@435 29 class PSGCAdaptivePolicyCounters : public GCAdaptivePolicyCounters {
duke@435 30 friend class VMStructs;
duke@435 31
duke@435 32 private:
duke@435 33 // survivor space vs. tenuring threshold
duke@435 34 PerfVariable* _old_promo_size;
duke@435 35 PerfVariable* _old_eden_size;
duke@435 36 PerfVariable* _avg_promoted_avg_counter;
duke@435 37 PerfVariable* _avg_promoted_dev_counter;
duke@435 38 PerfVariable* _avg_promoted_padded_avg_counter;
duke@435 39 PerfVariable* _avg_pretenured_padded_avg;
duke@435 40
duke@435 41 // young gen vs. old gen sizing
duke@435 42 PerfVariable* _avg_major_pause;
duke@435 43 PerfVariable* _avg_major_interval;
duke@435 44 PerfVariable* _live_space;
duke@435 45 PerfVariable* _free_space;
duke@435 46 PerfVariable* _avg_base_footprint;
jmasa@1822 47 PerfVariable* _gc_overhead_limit_exceeded_counter;
jmasa@1822 48 PerfVariable* _live_at_last_full_gc_counter;
duke@435 49 PerfVariable* _old_capacity;
duke@435 50 PerfVariable* _boundary_moved;
duke@435 51
duke@435 52 PerfVariable* _change_old_gen_for_min_pauses;
duke@435 53 PerfVariable* _change_young_gen_for_maj_pauses_counter;
duke@435 54
duke@435 55 PerfVariable* _major_pause_old_slope;
duke@435 56 PerfVariable* _minor_pause_old_slope;
duke@435 57 PerfVariable* _major_pause_young_slope;
duke@435 58
duke@435 59 PerfVariable* _scavenge_skipped;
duke@435 60 PerfVariable* _full_follows_scavenge;
duke@435 61
duke@435 62 // Use this time stamp if the gc time stamp is not available.
duke@435 63 TimeStamp _counter_time_stamp;
duke@435 64
duke@435 65 protected:
duke@435 66 PSAdaptiveSizePolicy* ps_size_policy() {
duke@435 67 return (PSAdaptiveSizePolicy*)_size_policy;
duke@435 68 }
duke@435 69
duke@435 70 public:
duke@435 71 PSGCAdaptivePolicyCounters(const char* name, int collectors, int generations,
duke@435 72 PSAdaptiveSizePolicy* size_policy);
duke@435 73 inline void update_old_capacity(size_t size_in_bytes) {
duke@435 74 _old_capacity->set_value(size_in_bytes);
duke@435 75 }
duke@435 76 inline void update_old_eden_size(size_t old_size) {
duke@435 77 _old_eden_size->set_value(old_size);
duke@435 78 }
duke@435 79 inline void update_old_promo_size(size_t old_size) {
duke@435 80 _old_promo_size->set_value(old_size);
duke@435 81 }
duke@435 82 inline void update_boundary_moved(int size_in_bytes) {
duke@435 83 _boundary_moved->set_value(size_in_bytes);
duke@435 84 }
duke@435 85 inline void update_avg_promoted_avg() {
duke@435 86 _avg_promoted_avg_counter->set_value(
duke@435 87 (jlong)(ps_size_policy()->avg_promoted()->average())
duke@435 88 );
duke@435 89 }
duke@435 90 inline void update_avg_promoted_dev() {
duke@435 91 _avg_promoted_dev_counter->set_value(
duke@435 92 (jlong)(ps_size_policy()->avg_promoted()->deviation())
duke@435 93 );
duke@435 94 }
duke@435 95 inline void update_avg_promoted_padded_avg() {
duke@435 96 _avg_promoted_padded_avg_counter->set_value(
duke@435 97 (jlong)(ps_size_policy()->avg_promoted()->padded_average())
duke@435 98 );
duke@435 99 }
duke@435 100
duke@435 101 inline void update_avg_pretenured_padded_avg() {
duke@435 102 _avg_pretenured_padded_avg->set_value(
duke@435 103 (jlong)(ps_size_policy()->_avg_pretenured->padded_average())
duke@435 104 );
duke@435 105 }
duke@435 106 inline void update_change_young_gen_for_maj_pauses() {
duke@435 107 _change_young_gen_for_maj_pauses_counter->set_value(
duke@435 108 ps_size_policy()->change_young_gen_for_maj_pauses());
duke@435 109 }
duke@435 110 inline void update_change_old_gen_for_min_pauses() {
duke@435 111 _change_old_gen_for_min_pauses->set_value(
duke@435 112 ps_size_policy()->change_old_gen_for_min_pauses());
duke@435 113 }
duke@435 114
duke@435 115 // compute_generation_free_space() statistics
duke@435 116
duke@435 117 inline void update_avg_major_pause() {
duke@435 118 _avg_major_pause->set_value(
duke@435 119 (jlong)(ps_size_policy()->_avg_major_pause->average() * 1000.0)
duke@435 120 );
duke@435 121 }
duke@435 122 inline void update_avg_major_interval() {
duke@435 123 _avg_major_interval->set_value(
duke@435 124 (jlong)(ps_size_policy()->_avg_major_interval->average() * 1000.0)
duke@435 125 );
duke@435 126 }
duke@435 127
duke@435 128 inline void update_major_gc_cost_counter() {
duke@435 129 _major_gc_cost_counter->set_value(
duke@435 130 (jlong)(ps_size_policy()->major_gc_cost() * 100.0)
duke@435 131 );
duke@435 132 }
duke@435 133 inline void update_mutator_cost_counter() {
duke@435 134 _mutator_cost_counter->set_value(
duke@435 135 (jlong)(ps_size_policy()->mutator_cost() * 100.0)
duke@435 136 );
duke@435 137 }
duke@435 138
duke@435 139 inline void update_live_space() {
duke@435 140 _live_space->set_value(ps_size_policy()->live_space());
duke@435 141 }
duke@435 142 inline void update_free_space() {
duke@435 143 _free_space->set_value(ps_size_policy()->free_space());
duke@435 144 }
duke@435 145
duke@435 146 inline void update_avg_base_footprint() {
duke@435 147 _avg_base_footprint->set_value(
duke@435 148 (jlong)(ps_size_policy()->avg_base_footprint()->average())
duke@435 149 );
duke@435 150 }
duke@435 151 inline void update_avg_old_live() {
duke@435 152 _avg_old_live_counter->set_value(
duke@435 153 (jlong)(ps_size_policy()->avg_old_live()->average())
duke@435 154 );
duke@435 155 }
duke@435 156 // Scale up all the slopes
duke@435 157 inline void update_major_pause_old_slope() {
duke@435 158 _major_pause_old_slope->set_value(
duke@435 159 (jlong)(ps_size_policy()->major_pause_old_slope() * 1000)
duke@435 160 );
duke@435 161 }
duke@435 162 inline void update_minor_pause_old_slope() {
duke@435 163 _minor_pause_old_slope->set_value(
duke@435 164 (jlong)(ps_size_policy()->minor_pause_old_slope() * 1000)
duke@435 165 );
duke@435 166 }
duke@435 167 inline void update_major_pause_young_slope() {
duke@435 168 _major_pause_young_slope->set_value(
duke@435 169 (jlong)(ps_size_policy()->major_pause_young_slope() * 1000)
duke@435 170 );
duke@435 171 }
jmasa@1822 172 inline void update_gc_overhead_limit_exceeded_counter() {
jmasa@1822 173 _gc_overhead_limit_exceeded_counter->set_value(
jmasa@1822 174 (jlong) ps_size_policy()->gc_overhead_limit_exceeded());
jmasa@1822 175 }
jmasa@1822 176 inline void update_live_at_last_full_gc_counter() {
jmasa@1822 177 _live_at_last_full_gc_counter->set_value(
jmasa@1822 178 (jlong)(ps_size_policy()->live_at_last_full_gc()));
jmasa@1822 179 }
duke@435 180
duke@435 181 inline void update_scavenge_skipped(int cause) {
duke@435 182 _scavenge_skipped->set_value(cause);
duke@435 183 }
duke@435 184
duke@435 185 inline void update_full_follows_scavenge(int event) {
duke@435 186 _full_follows_scavenge->set_value(event);
duke@435 187 }
duke@435 188
duke@435 189 // Update all the counters that can be updated from the size policy.
duke@435 190 // This should be called after all policy changes have been made
duke@435 191 // and reflected internall in the size policy.
duke@435 192 void update_counters_from_policy();
duke@435 193
duke@435 194 // Update counters that can be updated from fields internal to the
duke@435 195 // counter or from globals. This is distinguished from counters
duke@435 196 // that are updated via input parameters.
duke@435 197 void update_counters();
duke@435 198
duke@435 199 virtual GCPolicyCounters::Name kind() const {
duke@435 200 return GCPolicyCounters::PSGCAdaptivePolicyCountersKind;
duke@435 201 }
duke@435 202 };

mercurial