annotate src/share/vm/gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.hpp @ 1552:c18cbe5936b8

6941466: Oracle rebranding changes for Hotspot repositories Summary: Change all the Sun copyrights to Oracle copyright Reviewed-by: ohair
author trims
date Thu, 27 May 2010 19:08:38 -0700
parents 98cb887364d3
children f95d63e2154a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 605
diff changeset
2 * Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 605
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 605
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 605
diff changeset
21 * questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
a61af66fc99e Initial load
duke
parents:
diff changeset
25 // CMSGCAdaptivePolicyCounters is a holder class for performance counters
a61af66fc99e Initial load
duke
parents:
diff changeset
26 // that track the data and decisions for the ergonomics policy for the
a61af66fc99e Initial load
duke
parents:
diff changeset
27 // concurrent mark sweep collector
a61af66fc99e Initial load
duke
parents:
diff changeset
28
a61af66fc99e Initial load
duke
parents:
diff changeset
29 class CMSGCAdaptivePolicyCounters : public GCAdaptivePolicyCounters {
a61af66fc99e Initial load
duke
parents:
diff changeset
30 friend class VMStructs;
a61af66fc99e Initial load
duke
parents:
diff changeset
31
a61af66fc99e Initial load
duke
parents:
diff changeset
32 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
33
a61af66fc99e Initial load
duke
parents:
diff changeset
34 // Capacity of tenured generation recorded at the end of
a61af66fc99e Initial load
duke
parents:
diff changeset
35 // any collection.
a61af66fc99e Initial load
duke
parents:
diff changeset
36 PerfVariable* _cms_capacity_counter; // Make this common with PS _old_capacity
a61af66fc99e Initial load
duke
parents:
diff changeset
37
a61af66fc99e Initial load
duke
parents:
diff changeset
38 // Average stop-the-world pause time for both initial and
a61af66fc99e Initial load
duke
parents:
diff changeset
39 // remark pauses sampled at the end of the checkpointRootsFinalWork.
a61af66fc99e Initial load
duke
parents:
diff changeset
40 PerfVariable* _avg_cms_STW_time_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
41 // Average stop-the-world (STW) GC cost for the STW pause time
a61af66fc99e Initial load
duke
parents:
diff changeset
42 // _avg_cms_STW_time_counter.
a61af66fc99e Initial load
duke
parents:
diff changeset
43 PerfVariable* _avg_cms_STW_gc_cost_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
44
a61af66fc99e Initial load
duke
parents:
diff changeset
45 #ifdef NOT_PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
46 // These are useful to see how the most recent values of these
a61af66fc99e Initial load
duke
parents:
diff changeset
47 // counters compare to their respective averages but
a61af66fc99e Initial load
duke
parents:
diff changeset
48 // do not control behavior.
a61af66fc99e Initial load
duke
parents:
diff changeset
49 PerfVariable* _initial_pause_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
50 PerfVariable* _remark_pause_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
51 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
52
a61af66fc99e Initial load
duke
parents:
diff changeset
53 // Average of the initial marking pause for a concurrent collection.
a61af66fc99e Initial load
duke
parents:
diff changeset
54 PerfVariable* _avg_initial_pause_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
55 // Average of the remark pause for a concurrent collection.
a61af66fc99e Initial load
duke
parents:
diff changeset
56 PerfVariable* _avg_remark_pause_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
57
a61af66fc99e Initial load
duke
parents:
diff changeset
58 // Average for the sum of all the concurrent times per collection.
a61af66fc99e Initial load
duke
parents:
diff changeset
59 PerfVariable* _avg_concurrent_time_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
60 // Average for the time between the most recent end of a
a61af66fc99e Initial load
duke
parents:
diff changeset
61 // concurrent collection and the beginning of the next
a61af66fc99e Initial load
duke
parents:
diff changeset
62 // concurrent collection.
a61af66fc99e Initial load
duke
parents:
diff changeset
63 PerfVariable* _avg_concurrent_interval_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
64 // Average of the concurrent GC costs based on _avg_concurrent_time_counter
a61af66fc99e Initial load
duke
parents:
diff changeset
65 // and _avg_concurrent_interval_counter.
a61af66fc99e Initial load
duke
parents:
diff changeset
66 PerfVariable* _avg_concurrent_gc_cost_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
67
a61af66fc99e Initial load
duke
parents:
diff changeset
68 // Average of the free space in the tenured generation at the
a61af66fc99e Initial load
duke
parents:
diff changeset
69 // end of the sweep of the tenured generation.
a61af66fc99e Initial load
duke
parents:
diff changeset
70 PerfVariable* _avg_cms_free_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
71 // Average of the free space in the tenured generation at the
605
98cb887364d3 6810672: Comment typos
twisti
parents: 0
diff changeset
72 // start of the sweep of the tenured generation.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
73 PerfVariable* _avg_cms_free_at_sweep_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
74 // Average of the free space in the tenured generation at the
a61af66fc99e Initial load
duke
parents:
diff changeset
75 // after any resizing of the tenured generation at the end
a61af66fc99e Initial load
duke
parents:
diff changeset
76 // of a collection of the tenured generation.
a61af66fc99e Initial load
duke
parents:
diff changeset
77 PerfVariable* _avg_cms_promo_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
78
a61af66fc99e Initial load
duke
parents:
diff changeset
79 // Average of the mark-sweep-compact (MSC) pause time for a collection
a61af66fc99e Initial load
duke
parents:
diff changeset
80 // of the tenured generation.
a61af66fc99e Initial load
duke
parents:
diff changeset
81 PerfVariable* _avg_msc_pause_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
82 // Average for the time between the most recent end of a
a61af66fc99e Initial load
duke
parents:
diff changeset
83 // MSC collection and the beginning of the next
a61af66fc99e Initial load
duke
parents:
diff changeset
84 // MSC collection.
a61af66fc99e Initial load
duke
parents:
diff changeset
85 PerfVariable* _avg_msc_interval_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
86 // Average for the GC cost of a MSC collection based on
a61af66fc99e Initial load
duke
parents:
diff changeset
87 // _avg_msc_pause_counter and _avg_msc_interval_counter.
a61af66fc99e Initial load
duke
parents:
diff changeset
88 PerfVariable* _msc_gc_cost_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
89
a61af66fc99e Initial load
duke
parents:
diff changeset
90 // Average of the mark-sweep (MS) pause time for a collection
a61af66fc99e Initial load
duke
parents:
diff changeset
91 // of the tenured generation.
a61af66fc99e Initial load
duke
parents:
diff changeset
92 PerfVariable* _avg_ms_pause_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
93 // Average for the time between the most recent end of a
a61af66fc99e Initial load
duke
parents:
diff changeset
94 // MS collection and the beginning of the next
a61af66fc99e Initial load
duke
parents:
diff changeset
95 // MS collection.
a61af66fc99e Initial load
duke
parents:
diff changeset
96 PerfVariable* _avg_ms_interval_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
97 // Average for the GC cost of a MS collection based on
a61af66fc99e Initial load
duke
parents:
diff changeset
98 // _avg_ms_pause_counter and _avg_ms_interval_counter.
a61af66fc99e Initial load
duke
parents:
diff changeset
99 PerfVariable* _ms_gc_cost_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
100
a61af66fc99e Initial load
duke
parents:
diff changeset
101 // Average of the bytes promoted per minor collection.
a61af66fc99e Initial load
duke
parents:
diff changeset
102 PerfVariable* _promoted_avg_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
103 // Average of the deviation of the promoted average
a61af66fc99e Initial load
duke
parents:
diff changeset
104 PerfVariable* _promoted_avg_dev_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
105 // Padded average of the bytes promoted per minor colleciton
a61af66fc99e Initial load
duke
parents:
diff changeset
106 PerfVariable* _promoted_padded_avg_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
107
a61af66fc99e Initial load
duke
parents:
diff changeset
108 // See description of the _change_young_gen_for_maj_pauses
a61af66fc99e Initial load
duke
parents:
diff changeset
109 // variable recently in cmsAdaptiveSizePolicy.hpp.
a61af66fc99e Initial load
duke
parents:
diff changeset
110 PerfVariable* _change_young_gen_for_maj_pauses_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
111
a61af66fc99e Initial load
duke
parents:
diff changeset
112 // See descriptions of _remark_pause_old_slope, _initial_pause_old_slope,
a61af66fc99e Initial load
duke
parents:
diff changeset
113 // etc. variables recently in cmsAdaptiveSizePolicy.hpp.
a61af66fc99e Initial load
duke
parents:
diff changeset
114 PerfVariable* _remark_pause_old_slope_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
115 PerfVariable* _initial_pause_old_slope_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
116 PerfVariable* _remark_pause_young_slope_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
117 PerfVariable* _initial_pause_young_slope_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
118
a61af66fc99e Initial load
duke
parents:
diff changeset
119 CMSAdaptiveSizePolicy* cms_size_policy() {
a61af66fc99e Initial load
duke
parents:
diff changeset
120 assert(_size_policy->kind() ==
a61af66fc99e Initial load
duke
parents:
diff changeset
121 AdaptiveSizePolicy::_gc_cms_adaptive_size_policy,
a61af66fc99e Initial load
duke
parents:
diff changeset
122 "Wrong size policy");
a61af66fc99e Initial load
duke
parents:
diff changeset
123 return (CMSAdaptiveSizePolicy*)_size_policy;
a61af66fc99e Initial load
duke
parents:
diff changeset
124 }
a61af66fc99e Initial load
duke
parents:
diff changeset
125
a61af66fc99e Initial load
duke
parents:
diff changeset
126 inline void update_avg_cms_STW_time_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
127 _avg_cms_STW_time_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
128 (jlong) (cms_size_policy()->avg_cms_STW_time()->average() *
a61af66fc99e Initial load
duke
parents:
diff changeset
129 (double) MILLIUNITS));
a61af66fc99e Initial load
duke
parents:
diff changeset
130 }
a61af66fc99e Initial load
duke
parents:
diff changeset
131
a61af66fc99e Initial load
duke
parents:
diff changeset
132 inline void update_avg_cms_STW_gc_cost_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
133 _avg_cms_STW_gc_cost_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
134 (jlong) (cms_size_policy()->avg_cms_STW_gc_cost()->average() * 100.0));
a61af66fc99e Initial load
duke
parents:
diff changeset
135 }
a61af66fc99e Initial load
duke
parents:
diff changeset
136
a61af66fc99e Initial load
duke
parents:
diff changeset
137 inline void update_avg_initial_pause_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
138 _avg_initial_pause_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
139 (jlong) (cms_size_policy()->avg_initial_pause()->average() *
a61af66fc99e Initial load
duke
parents:
diff changeset
140 (double) MILLIUNITS));
a61af66fc99e Initial load
duke
parents:
diff changeset
141 }
a61af66fc99e Initial load
duke
parents:
diff changeset
142 #ifdef NOT_PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
143 inline void update_avg_remark_pause_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
144 _avg_remark_pause_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
145 (jlong) (cms_size_policy()-> avg_remark_pause()->average() *
a61af66fc99e Initial load
duke
parents:
diff changeset
146 (double) MILLIUNITS));
a61af66fc99e Initial load
duke
parents:
diff changeset
147 }
a61af66fc99e Initial load
duke
parents:
diff changeset
148
a61af66fc99e Initial load
duke
parents:
diff changeset
149 inline void update_initial_pause_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
150 _initial_pause_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
151 (jlong) (cms_size_policy()->avg_initial_pause()->average() *
a61af66fc99e Initial load
duke
parents:
diff changeset
152 (double) MILLIUNITS));
a61af66fc99e Initial load
duke
parents:
diff changeset
153 }
a61af66fc99e Initial load
duke
parents:
diff changeset
154 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
155 inline void update_remark_pause_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
156 _remark_pause_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
157 (jlong) (cms_size_policy()-> avg_remark_pause()->last_sample() *
a61af66fc99e Initial load
duke
parents:
diff changeset
158 (double) MILLIUNITS));
a61af66fc99e Initial load
duke
parents:
diff changeset
159 }
a61af66fc99e Initial load
duke
parents:
diff changeset
160
a61af66fc99e Initial load
duke
parents:
diff changeset
161 inline void update_avg_concurrent_time_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
162 _avg_concurrent_time_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
163 (jlong) (cms_size_policy()->avg_concurrent_time()->last_sample() *
a61af66fc99e Initial load
duke
parents:
diff changeset
164 (double) MILLIUNITS));
a61af66fc99e Initial load
duke
parents:
diff changeset
165 }
a61af66fc99e Initial load
duke
parents:
diff changeset
166
a61af66fc99e Initial load
duke
parents:
diff changeset
167 inline void update_avg_concurrent_interval_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
168 _avg_concurrent_interval_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
169 (jlong) (cms_size_policy()->avg_concurrent_interval()->average() *
a61af66fc99e Initial load
duke
parents:
diff changeset
170 (double) MILLIUNITS));
a61af66fc99e Initial load
duke
parents:
diff changeset
171 }
a61af66fc99e Initial load
duke
parents:
diff changeset
172
a61af66fc99e Initial load
duke
parents:
diff changeset
173 inline void update_avg_concurrent_gc_cost_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
174 _avg_concurrent_gc_cost_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
175 (jlong) (cms_size_policy()->avg_concurrent_gc_cost()->average() * 100.0));
a61af66fc99e Initial load
duke
parents:
diff changeset
176 }
a61af66fc99e Initial load
duke
parents:
diff changeset
177
a61af66fc99e Initial load
duke
parents:
diff changeset
178 inline void update_avg_cms_free_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
179 _avg_cms_free_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
180 (jlong) cms_size_policy()->avg_cms_free()->average());
a61af66fc99e Initial load
duke
parents:
diff changeset
181 }
a61af66fc99e Initial load
duke
parents:
diff changeset
182
a61af66fc99e Initial load
duke
parents:
diff changeset
183 inline void update_avg_cms_free_at_sweep_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
184 _avg_cms_free_at_sweep_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
185 (jlong) cms_size_policy()->avg_cms_free_at_sweep()->average());
a61af66fc99e Initial load
duke
parents:
diff changeset
186 }
a61af66fc99e Initial load
duke
parents:
diff changeset
187
a61af66fc99e Initial load
duke
parents:
diff changeset
188 inline void update_avg_cms_promo_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
189 _avg_cms_promo_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
190 (jlong) cms_size_policy()->avg_cms_promo()->average());
a61af66fc99e Initial load
duke
parents:
diff changeset
191 }
a61af66fc99e Initial load
duke
parents:
diff changeset
192
a61af66fc99e Initial load
duke
parents:
diff changeset
193 inline void update_avg_old_live_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
194 _avg_old_live_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
195 (jlong)(cms_size_policy()->avg_old_live()->average())
a61af66fc99e Initial load
duke
parents:
diff changeset
196 );
a61af66fc99e Initial load
duke
parents:
diff changeset
197 }
a61af66fc99e Initial load
duke
parents:
diff changeset
198
a61af66fc99e Initial load
duke
parents:
diff changeset
199 inline void update_avg_msc_pause_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
200 _avg_msc_pause_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
201 (jlong) (cms_size_policy()->avg_msc_pause()->average() *
a61af66fc99e Initial load
duke
parents:
diff changeset
202 (double) MILLIUNITS));
a61af66fc99e Initial load
duke
parents:
diff changeset
203 }
a61af66fc99e Initial load
duke
parents:
diff changeset
204
a61af66fc99e Initial load
duke
parents:
diff changeset
205 inline void update_avg_msc_interval_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
206 _avg_msc_interval_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
207 (jlong) (cms_size_policy()->avg_msc_interval()->average() *
a61af66fc99e Initial load
duke
parents:
diff changeset
208 (double) MILLIUNITS));
a61af66fc99e Initial load
duke
parents:
diff changeset
209 }
a61af66fc99e Initial load
duke
parents:
diff changeset
210
a61af66fc99e Initial load
duke
parents:
diff changeset
211 inline void update_msc_gc_cost_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
212 _msc_gc_cost_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
213 (jlong) (cms_size_policy()->avg_msc_gc_cost()->average() * 100.0));
a61af66fc99e Initial load
duke
parents:
diff changeset
214 }
a61af66fc99e Initial load
duke
parents:
diff changeset
215
a61af66fc99e Initial load
duke
parents:
diff changeset
216 inline void update_avg_ms_pause_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
217 _avg_ms_pause_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
218 (jlong) (cms_size_policy()->avg_ms_pause()->average() *
a61af66fc99e Initial load
duke
parents:
diff changeset
219 (double) MILLIUNITS));
a61af66fc99e Initial load
duke
parents:
diff changeset
220 }
a61af66fc99e Initial load
duke
parents:
diff changeset
221
a61af66fc99e Initial load
duke
parents:
diff changeset
222 inline void update_avg_ms_interval_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
223 _avg_ms_interval_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
224 (jlong) (cms_size_policy()->avg_ms_interval()->average() *
a61af66fc99e Initial load
duke
parents:
diff changeset
225 (double) MILLIUNITS));
a61af66fc99e Initial load
duke
parents:
diff changeset
226 }
a61af66fc99e Initial load
duke
parents:
diff changeset
227
a61af66fc99e Initial load
duke
parents:
diff changeset
228 inline void update_ms_gc_cost_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
229 _ms_gc_cost_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
230 (jlong) (cms_size_policy()->avg_ms_gc_cost()->average() * 100.0));
a61af66fc99e Initial load
duke
parents:
diff changeset
231 }
a61af66fc99e Initial load
duke
parents:
diff changeset
232
a61af66fc99e Initial load
duke
parents:
diff changeset
233 inline void update_major_gc_cost_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
234 _major_gc_cost_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
235 (jlong)(cms_size_policy()->cms_gc_cost() * 100.0)
a61af66fc99e Initial load
duke
parents:
diff changeset
236 );
a61af66fc99e Initial load
duke
parents:
diff changeset
237 }
a61af66fc99e Initial load
duke
parents:
diff changeset
238 inline void update_mutator_cost_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
239 _mutator_cost_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
240 (jlong)(cms_size_policy()->mutator_cost() * 100.0)
a61af66fc99e Initial load
duke
parents:
diff changeset
241 );
a61af66fc99e Initial load
duke
parents:
diff changeset
242 }
a61af66fc99e Initial load
duke
parents:
diff changeset
243
a61af66fc99e Initial load
duke
parents:
diff changeset
244 inline void update_avg_promoted_avg(CMSGCStats* gc_stats) {
a61af66fc99e Initial load
duke
parents:
diff changeset
245 _promoted_avg_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
246 (jlong)(gc_stats->avg_promoted()->average())
a61af66fc99e Initial load
duke
parents:
diff changeset
247 );
a61af66fc99e Initial load
duke
parents:
diff changeset
248 }
a61af66fc99e Initial load
duke
parents:
diff changeset
249 inline void update_avg_promoted_dev(CMSGCStats* gc_stats) {
a61af66fc99e Initial load
duke
parents:
diff changeset
250 _promoted_avg_dev_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
251 (jlong)(gc_stats->avg_promoted()->deviation())
a61af66fc99e Initial load
duke
parents:
diff changeset
252 );
a61af66fc99e Initial load
duke
parents:
diff changeset
253 }
a61af66fc99e Initial load
duke
parents:
diff changeset
254 inline void update_avg_promoted_padded_avg(CMSGCStats* gc_stats) {
a61af66fc99e Initial load
duke
parents:
diff changeset
255 _promoted_padded_avg_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
256 (jlong)(gc_stats->avg_promoted()->padded_average())
a61af66fc99e Initial load
duke
parents:
diff changeset
257 );
a61af66fc99e Initial load
duke
parents:
diff changeset
258 }
a61af66fc99e Initial load
duke
parents:
diff changeset
259 inline void update_remark_pause_old_slope_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
260 _remark_pause_old_slope_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
261 (jlong)(cms_size_policy()->remark_pause_old_slope() * 1000)
a61af66fc99e Initial load
duke
parents:
diff changeset
262 );
a61af66fc99e Initial load
duke
parents:
diff changeset
263 }
a61af66fc99e Initial load
duke
parents:
diff changeset
264 inline void update_initial_pause_old_slope_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
265 _initial_pause_old_slope_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
266 (jlong)(cms_size_policy()->initial_pause_old_slope() * 1000)
a61af66fc99e Initial load
duke
parents:
diff changeset
267 );
a61af66fc99e Initial load
duke
parents:
diff changeset
268 }
a61af66fc99e Initial load
duke
parents:
diff changeset
269 inline void update_remark_pause_young_slope_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
270 _remark_pause_young_slope_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
271 (jlong)(cms_size_policy()->remark_pause_young_slope() * 1000)
a61af66fc99e Initial load
duke
parents:
diff changeset
272 );
a61af66fc99e Initial load
duke
parents:
diff changeset
273 }
a61af66fc99e Initial load
duke
parents:
diff changeset
274 inline void update_initial_pause_young_slope_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
275 _initial_pause_young_slope_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
276 (jlong)(cms_size_policy()->initial_pause_young_slope() * 1000)
a61af66fc99e Initial load
duke
parents:
diff changeset
277 );
a61af66fc99e Initial load
duke
parents:
diff changeset
278 }
a61af66fc99e Initial load
duke
parents:
diff changeset
279 inline void update_change_young_gen_for_maj_pauses() {
a61af66fc99e Initial load
duke
parents:
diff changeset
280 _change_young_gen_for_maj_pauses_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
281 cms_size_policy()->change_young_gen_for_maj_pauses());
a61af66fc99e Initial load
duke
parents:
diff changeset
282 }
a61af66fc99e Initial load
duke
parents:
diff changeset
283
a61af66fc99e Initial load
duke
parents:
diff changeset
284 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
285 CMSGCAdaptivePolicyCounters(const char* name, int collectors, int generations,
a61af66fc99e Initial load
duke
parents:
diff changeset
286 AdaptiveSizePolicy* size_policy);
a61af66fc99e Initial load
duke
parents:
diff changeset
287
a61af66fc99e Initial load
duke
parents:
diff changeset
288 // update counters
a61af66fc99e Initial load
duke
parents:
diff changeset
289 void update_counters();
a61af66fc99e Initial load
duke
parents:
diff changeset
290 void update_counters(CMSGCStats* gc_stats);
a61af66fc99e Initial load
duke
parents:
diff changeset
291 void update_counters_from_policy();
a61af66fc99e Initial load
duke
parents:
diff changeset
292
a61af66fc99e Initial load
duke
parents:
diff changeset
293 inline void update_cms_capacity_counter(size_t size_in_bytes) {
a61af66fc99e Initial load
duke
parents:
diff changeset
294 _cms_capacity_counter->set_value(size_in_bytes);
a61af66fc99e Initial load
duke
parents:
diff changeset
295 }
a61af66fc99e Initial load
duke
parents:
diff changeset
296
a61af66fc99e Initial load
duke
parents:
diff changeset
297 virtual GCPolicyCounters::Name kind() const {
a61af66fc99e Initial load
duke
parents:
diff changeset
298 return GCPolicyCounters::CMSGCAdaptivePolicyCountersKind;
a61af66fc99e Initial load
duke
parents:
diff changeset
299 }
a61af66fc99e Initial load
duke
parents:
diff changeset
300 };