annotate src/share/vm/gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.hpp @ 6862:8a5ea0a9ccc4

7127708: G1: change task num types from int to uint in concurrent mark Summary: Change the type of various task num fields, parameters etc to unsigned and rename them to be more consistent with the other collectors. Code changes were also reviewed by Vitaly Davidovich. Reviewed-by: johnc Contributed-by: Kaushik Srenevasan <kaushik@twitter.com>
author johnc
date Sat, 06 Oct 2012 01:17:44 -0700
parents f95d63e2154a
children 63a4eb8bcd23
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
2 * Copyright (c) 2004, 2010, 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
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
25 #ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSGCADAPTIVEPOLICYCOUNTERS_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
26 #define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSGCADAPTIVEPOLICYCOUNTERS_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
27
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
28 #include "gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
29 #include "gc_implementation/shared/gcAdaptivePolicyCounters.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
30 #include "gc_implementation/shared/gcStats.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
31 #include "runtime/perfData.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
32
0
a61af66fc99e Initial load
duke
parents:
diff changeset
33 // CMSGCAdaptivePolicyCounters is a holder class for performance counters
a61af66fc99e Initial load
duke
parents:
diff changeset
34 // that track the data and decisions for the ergonomics policy for the
a61af66fc99e Initial load
duke
parents:
diff changeset
35 // concurrent mark sweep collector
a61af66fc99e Initial load
duke
parents:
diff changeset
36
a61af66fc99e Initial load
duke
parents:
diff changeset
37 class CMSGCAdaptivePolicyCounters : public GCAdaptivePolicyCounters {
a61af66fc99e Initial load
duke
parents:
diff changeset
38 friend class VMStructs;
a61af66fc99e Initial load
duke
parents:
diff changeset
39
a61af66fc99e Initial load
duke
parents:
diff changeset
40 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
41
a61af66fc99e Initial load
duke
parents:
diff changeset
42 // Capacity of tenured generation recorded at the end of
a61af66fc99e Initial load
duke
parents:
diff changeset
43 // any collection.
a61af66fc99e Initial load
duke
parents:
diff changeset
44 PerfVariable* _cms_capacity_counter; // Make this common with PS _old_capacity
a61af66fc99e Initial load
duke
parents:
diff changeset
45
a61af66fc99e Initial load
duke
parents:
diff changeset
46 // Average stop-the-world pause time for both initial and
a61af66fc99e Initial load
duke
parents:
diff changeset
47 // remark pauses sampled at the end of the checkpointRootsFinalWork.
a61af66fc99e Initial load
duke
parents:
diff changeset
48 PerfVariable* _avg_cms_STW_time_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
49 // Average stop-the-world (STW) GC cost for the STW pause time
a61af66fc99e Initial load
duke
parents:
diff changeset
50 // _avg_cms_STW_time_counter.
a61af66fc99e Initial load
duke
parents:
diff changeset
51 PerfVariable* _avg_cms_STW_gc_cost_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
52
a61af66fc99e Initial load
duke
parents:
diff changeset
53 #ifdef NOT_PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
54 // These are useful to see how the most recent values of these
a61af66fc99e Initial load
duke
parents:
diff changeset
55 // counters compare to their respective averages but
a61af66fc99e Initial load
duke
parents:
diff changeset
56 // do not control behavior.
a61af66fc99e Initial load
duke
parents:
diff changeset
57 PerfVariable* _initial_pause_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
58 PerfVariable* _remark_pause_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
59 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
60
a61af66fc99e Initial load
duke
parents:
diff changeset
61 // Average of the initial marking pause for a concurrent collection.
a61af66fc99e Initial load
duke
parents:
diff changeset
62 PerfVariable* _avg_initial_pause_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
63 // Average of the remark pause for a concurrent collection.
a61af66fc99e Initial load
duke
parents:
diff changeset
64 PerfVariable* _avg_remark_pause_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
65
a61af66fc99e Initial load
duke
parents:
diff changeset
66 // Average for the sum of all the concurrent times per collection.
a61af66fc99e Initial load
duke
parents:
diff changeset
67 PerfVariable* _avg_concurrent_time_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
68 // Average for the time between the most recent end of a
a61af66fc99e Initial load
duke
parents:
diff changeset
69 // concurrent collection and the beginning of the next
a61af66fc99e Initial load
duke
parents:
diff changeset
70 // concurrent collection.
a61af66fc99e Initial load
duke
parents:
diff changeset
71 PerfVariable* _avg_concurrent_interval_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
72 // Average of the concurrent GC costs based on _avg_concurrent_time_counter
a61af66fc99e Initial load
duke
parents:
diff changeset
73 // and _avg_concurrent_interval_counter.
a61af66fc99e Initial load
duke
parents:
diff changeset
74 PerfVariable* _avg_concurrent_gc_cost_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
75
a61af66fc99e Initial load
duke
parents:
diff changeset
76 // Average of the free space in the tenured generation at the
a61af66fc99e Initial load
duke
parents:
diff changeset
77 // end of the sweep of the tenured generation.
a61af66fc99e Initial load
duke
parents:
diff changeset
78 PerfVariable* _avg_cms_free_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
79 // Average of the free space in the tenured generation at the
605
98cb887364d3 6810672: Comment typos
twisti
parents: 0
diff changeset
80 // start of the sweep of the tenured generation.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
81 PerfVariable* _avg_cms_free_at_sweep_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
82 // Average of the free space in the tenured generation at the
a61af66fc99e Initial load
duke
parents:
diff changeset
83 // after any resizing of the tenured generation at the end
a61af66fc99e Initial load
duke
parents:
diff changeset
84 // of a collection of the tenured generation.
a61af66fc99e Initial load
duke
parents:
diff changeset
85 PerfVariable* _avg_cms_promo_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
86
a61af66fc99e Initial load
duke
parents:
diff changeset
87 // Average of the mark-sweep-compact (MSC) pause time for a collection
a61af66fc99e Initial load
duke
parents:
diff changeset
88 // of the tenured generation.
a61af66fc99e Initial load
duke
parents:
diff changeset
89 PerfVariable* _avg_msc_pause_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
90 // Average for the time between the most recent end of a
a61af66fc99e Initial load
duke
parents:
diff changeset
91 // MSC collection and the beginning of the next
a61af66fc99e Initial load
duke
parents:
diff changeset
92 // MSC collection.
a61af66fc99e Initial load
duke
parents:
diff changeset
93 PerfVariable* _avg_msc_interval_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
94 // Average for the GC cost of a MSC collection based on
a61af66fc99e Initial load
duke
parents:
diff changeset
95 // _avg_msc_pause_counter and _avg_msc_interval_counter.
a61af66fc99e Initial load
duke
parents:
diff changeset
96 PerfVariable* _msc_gc_cost_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
97
a61af66fc99e Initial load
duke
parents:
diff changeset
98 // Average of the mark-sweep (MS) pause time for a collection
a61af66fc99e Initial load
duke
parents:
diff changeset
99 // of the tenured generation.
a61af66fc99e Initial load
duke
parents:
diff changeset
100 PerfVariable* _avg_ms_pause_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
101 // Average for the time between the most recent end of a
a61af66fc99e Initial load
duke
parents:
diff changeset
102 // MS collection and the beginning of the next
a61af66fc99e Initial load
duke
parents:
diff changeset
103 // MS collection.
a61af66fc99e Initial load
duke
parents:
diff changeset
104 PerfVariable* _avg_ms_interval_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
105 // Average for the GC cost of a MS collection based on
a61af66fc99e Initial load
duke
parents:
diff changeset
106 // _avg_ms_pause_counter and _avg_ms_interval_counter.
a61af66fc99e Initial load
duke
parents:
diff changeset
107 PerfVariable* _ms_gc_cost_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
108
a61af66fc99e Initial load
duke
parents:
diff changeset
109 // Average of the bytes promoted per minor collection.
a61af66fc99e Initial load
duke
parents:
diff changeset
110 PerfVariable* _promoted_avg_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
111 // Average of the deviation of the promoted average
a61af66fc99e Initial load
duke
parents:
diff changeset
112 PerfVariable* _promoted_avg_dev_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
113 // Padded average of the bytes promoted per minor colleciton
a61af66fc99e Initial load
duke
parents:
diff changeset
114 PerfVariable* _promoted_padded_avg_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
115
a61af66fc99e Initial load
duke
parents:
diff changeset
116 // See description of the _change_young_gen_for_maj_pauses
a61af66fc99e Initial load
duke
parents:
diff changeset
117 // variable recently in cmsAdaptiveSizePolicy.hpp.
a61af66fc99e Initial load
duke
parents:
diff changeset
118 PerfVariable* _change_young_gen_for_maj_pauses_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
119
a61af66fc99e Initial load
duke
parents:
diff changeset
120 // See descriptions of _remark_pause_old_slope, _initial_pause_old_slope,
a61af66fc99e Initial load
duke
parents:
diff changeset
121 // etc. variables recently in cmsAdaptiveSizePolicy.hpp.
a61af66fc99e Initial load
duke
parents:
diff changeset
122 PerfVariable* _remark_pause_old_slope_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
123 PerfVariable* _initial_pause_old_slope_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
124 PerfVariable* _remark_pause_young_slope_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
125 PerfVariable* _initial_pause_young_slope_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
126
a61af66fc99e Initial load
duke
parents:
diff changeset
127 CMSAdaptiveSizePolicy* cms_size_policy() {
a61af66fc99e Initial load
duke
parents:
diff changeset
128 assert(_size_policy->kind() ==
a61af66fc99e Initial load
duke
parents:
diff changeset
129 AdaptiveSizePolicy::_gc_cms_adaptive_size_policy,
a61af66fc99e Initial load
duke
parents:
diff changeset
130 "Wrong size policy");
a61af66fc99e Initial load
duke
parents:
diff changeset
131 return (CMSAdaptiveSizePolicy*)_size_policy;
a61af66fc99e Initial load
duke
parents:
diff changeset
132 }
a61af66fc99e Initial load
duke
parents:
diff changeset
133
a61af66fc99e Initial load
duke
parents:
diff changeset
134 inline void update_avg_cms_STW_time_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
135 _avg_cms_STW_time_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
136 (jlong) (cms_size_policy()->avg_cms_STW_time()->average() *
a61af66fc99e Initial load
duke
parents:
diff changeset
137 (double) MILLIUNITS));
a61af66fc99e Initial load
duke
parents:
diff changeset
138 }
a61af66fc99e Initial load
duke
parents:
diff changeset
139
a61af66fc99e Initial load
duke
parents:
diff changeset
140 inline void update_avg_cms_STW_gc_cost_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
141 _avg_cms_STW_gc_cost_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
142 (jlong) (cms_size_policy()->avg_cms_STW_gc_cost()->average() * 100.0));
a61af66fc99e Initial load
duke
parents:
diff changeset
143 }
a61af66fc99e Initial load
duke
parents:
diff changeset
144
a61af66fc99e Initial load
duke
parents:
diff changeset
145 inline void update_avg_initial_pause_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
146 _avg_initial_pause_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
147 (jlong) (cms_size_policy()->avg_initial_pause()->average() *
a61af66fc99e Initial load
duke
parents:
diff changeset
148 (double) MILLIUNITS));
a61af66fc99e Initial load
duke
parents:
diff changeset
149 }
a61af66fc99e Initial load
duke
parents:
diff changeset
150 #ifdef NOT_PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
151 inline void update_avg_remark_pause_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
152 _avg_remark_pause_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
153 (jlong) (cms_size_policy()-> avg_remark_pause()->average() *
a61af66fc99e Initial load
duke
parents:
diff changeset
154 (double) MILLIUNITS));
a61af66fc99e Initial load
duke
parents:
diff changeset
155 }
a61af66fc99e Initial load
duke
parents:
diff changeset
156
a61af66fc99e Initial load
duke
parents:
diff changeset
157 inline void update_initial_pause_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
158 _initial_pause_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
159 (jlong) (cms_size_policy()->avg_initial_pause()->average() *
a61af66fc99e Initial load
duke
parents:
diff changeset
160 (double) MILLIUNITS));
a61af66fc99e Initial load
duke
parents:
diff changeset
161 }
a61af66fc99e Initial load
duke
parents:
diff changeset
162 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
163 inline void update_remark_pause_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
164 _remark_pause_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
165 (jlong) (cms_size_policy()-> avg_remark_pause()->last_sample() *
a61af66fc99e Initial load
duke
parents:
diff changeset
166 (double) MILLIUNITS));
a61af66fc99e Initial load
duke
parents:
diff changeset
167 }
a61af66fc99e Initial load
duke
parents:
diff changeset
168
a61af66fc99e Initial load
duke
parents:
diff changeset
169 inline void update_avg_concurrent_time_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
170 _avg_concurrent_time_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
171 (jlong) (cms_size_policy()->avg_concurrent_time()->last_sample() *
a61af66fc99e Initial load
duke
parents:
diff changeset
172 (double) MILLIUNITS));
a61af66fc99e Initial load
duke
parents:
diff changeset
173 }
a61af66fc99e Initial load
duke
parents:
diff changeset
174
a61af66fc99e Initial load
duke
parents:
diff changeset
175 inline void update_avg_concurrent_interval_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
176 _avg_concurrent_interval_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
177 (jlong) (cms_size_policy()->avg_concurrent_interval()->average() *
a61af66fc99e Initial load
duke
parents:
diff changeset
178 (double) MILLIUNITS));
a61af66fc99e Initial load
duke
parents:
diff changeset
179 }
a61af66fc99e Initial load
duke
parents:
diff changeset
180
a61af66fc99e Initial load
duke
parents:
diff changeset
181 inline void update_avg_concurrent_gc_cost_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
182 _avg_concurrent_gc_cost_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
183 (jlong) (cms_size_policy()->avg_concurrent_gc_cost()->average() * 100.0));
a61af66fc99e Initial load
duke
parents:
diff changeset
184 }
a61af66fc99e Initial load
duke
parents:
diff changeset
185
a61af66fc99e Initial load
duke
parents:
diff changeset
186 inline void update_avg_cms_free_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
187 _avg_cms_free_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
188 (jlong) cms_size_policy()->avg_cms_free()->average());
a61af66fc99e Initial load
duke
parents:
diff changeset
189 }
a61af66fc99e Initial load
duke
parents:
diff changeset
190
a61af66fc99e Initial load
duke
parents:
diff changeset
191 inline void update_avg_cms_free_at_sweep_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
192 _avg_cms_free_at_sweep_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
193 (jlong) cms_size_policy()->avg_cms_free_at_sweep()->average());
a61af66fc99e Initial load
duke
parents:
diff changeset
194 }
a61af66fc99e Initial load
duke
parents:
diff changeset
195
a61af66fc99e Initial load
duke
parents:
diff changeset
196 inline void update_avg_cms_promo_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
197 _avg_cms_promo_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
198 (jlong) cms_size_policy()->avg_cms_promo()->average());
a61af66fc99e Initial load
duke
parents:
diff changeset
199 }
a61af66fc99e Initial load
duke
parents:
diff changeset
200
a61af66fc99e Initial load
duke
parents:
diff changeset
201 inline void update_avg_old_live_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
202 _avg_old_live_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
203 (jlong)(cms_size_policy()->avg_old_live()->average())
a61af66fc99e Initial load
duke
parents:
diff changeset
204 );
a61af66fc99e Initial load
duke
parents:
diff changeset
205 }
a61af66fc99e Initial load
duke
parents:
diff changeset
206
a61af66fc99e Initial load
duke
parents:
diff changeset
207 inline void update_avg_msc_pause_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
208 _avg_msc_pause_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
209 (jlong) (cms_size_policy()->avg_msc_pause()->average() *
a61af66fc99e Initial load
duke
parents:
diff changeset
210 (double) MILLIUNITS));
a61af66fc99e Initial load
duke
parents:
diff changeset
211 }
a61af66fc99e Initial load
duke
parents:
diff changeset
212
a61af66fc99e Initial load
duke
parents:
diff changeset
213 inline void update_avg_msc_interval_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
214 _avg_msc_interval_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
215 (jlong) (cms_size_policy()->avg_msc_interval()->average() *
a61af66fc99e Initial load
duke
parents:
diff changeset
216 (double) MILLIUNITS));
a61af66fc99e Initial load
duke
parents:
diff changeset
217 }
a61af66fc99e Initial load
duke
parents:
diff changeset
218
a61af66fc99e Initial load
duke
parents:
diff changeset
219 inline void update_msc_gc_cost_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
220 _msc_gc_cost_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
221 (jlong) (cms_size_policy()->avg_msc_gc_cost()->average() * 100.0));
a61af66fc99e Initial load
duke
parents:
diff changeset
222 }
a61af66fc99e Initial load
duke
parents:
diff changeset
223
a61af66fc99e Initial load
duke
parents:
diff changeset
224 inline void update_avg_ms_pause_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
225 _avg_ms_pause_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
226 (jlong) (cms_size_policy()->avg_ms_pause()->average() *
a61af66fc99e Initial load
duke
parents:
diff changeset
227 (double) MILLIUNITS));
a61af66fc99e Initial load
duke
parents:
diff changeset
228 }
a61af66fc99e Initial load
duke
parents:
diff changeset
229
a61af66fc99e Initial load
duke
parents:
diff changeset
230 inline void update_avg_ms_interval_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
231 _avg_ms_interval_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
232 (jlong) (cms_size_policy()->avg_ms_interval()->average() *
a61af66fc99e Initial load
duke
parents:
diff changeset
233 (double) MILLIUNITS));
a61af66fc99e Initial load
duke
parents:
diff changeset
234 }
a61af66fc99e Initial load
duke
parents:
diff changeset
235
a61af66fc99e Initial load
duke
parents:
diff changeset
236 inline void update_ms_gc_cost_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
237 _ms_gc_cost_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
238 (jlong) (cms_size_policy()->avg_ms_gc_cost()->average() * 100.0));
a61af66fc99e Initial load
duke
parents:
diff changeset
239 }
a61af66fc99e Initial load
duke
parents:
diff changeset
240
a61af66fc99e Initial load
duke
parents:
diff changeset
241 inline void update_major_gc_cost_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
242 _major_gc_cost_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
243 (jlong)(cms_size_policy()->cms_gc_cost() * 100.0)
a61af66fc99e Initial load
duke
parents:
diff changeset
244 );
a61af66fc99e Initial load
duke
parents:
diff changeset
245 }
a61af66fc99e Initial load
duke
parents:
diff changeset
246 inline void update_mutator_cost_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
247 _mutator_cost_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
248 (jlong)(cms_size_policy()->mutator_cost() * 100.0)
a61af66fc99e Initial load
duke
parents:
diff changeset
249 );
a61af66fc99e Initial load
duke
parents:
diff changeset
250 }
a61af66fc99e Initial load
duke
parents:
diff changeset
251
a61af66fc99e Initial load
duke
parents:
diff changeset
252 inline void update_avg_promoted_avg(CMSGCStats* gc_stats) {
a61af66fc99e Initial load
duke
parents:
diff changeset
253 _promoted_avg_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
254 (jlong)(gc_stats->avg_promoted()->average())
a61af66fc99e Initial load
duke
parents:
diff changeset
255 );
a61af66fc99e Initial load
duke
parents:
diff changeset
256 }
a61af66fc99e Initial load
duke
parents:
diff changeset
257 inline void update_avg_promoted_dev(CMSGCStats* gc_stats) {
a61af66fc99e Initial load
duke
parents:
diff changeset
258 _promoted_avg_dev_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
259 (jlong)(gc_stats->avg_promoted()->deviation())
a61af66fc99e Initial load
duke
parents:
diff changeset
260 );
a61af66fc99e Initial load
duke
parents:
diff changeset
261 }
a61af66fc99e Initial load
duke
parents:
diff changeset
262 inline void update_avg_promoted_padded_avg(CMSGCStats* gc_stats) {
a61af66fc99e Initial load
duke
parents:
diff changeset
263 _promoted_padded_avg_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
264 (jlong)(gc_stats->avg_promoted()->padded_average())
a61af66fc99e Initial load
duke
parents:
diff changeset
265 );
a61af66fc99e Initial load
duke
parents:
diff changeset
266 }
a61af66fc99e Initial load
duke
parents:
diff changeset
267 inline void update_remark_pause_old_slope_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
268 _remark_pause_old_slope_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
269 (jlong)(cms_size_policy()->remark_pause_old_slope() * 1000)
a61af66fc99e Initial load
duke
parents:
diff changeset
270 );
a61af66fc99e Initial load
duke
parents:
diff changeset
271 }
a61af66fc99e Initial load
duke
parents:
diff changeset
272 inline void update_initial_pause_old_slope_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
273 _initial_pause_old_slope_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
274 (jlong)(cms_size_policy()->initial_pause_old_slope() * 1000)
a61af66fc99e Initial load
duke
parents:
diff changeset
275 );
a61af66fc99e Initial load
duke
parents:
diff changeset
276 }
a61af66fc99e Initial load
duke
parents:
diff changeset
277 inline void update_remark_pause_young_slope_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
278 _remark_pause_young_slope_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
279 (jlong)(cms_size_policy()->remark_pause_young_slope() * 1000)
a61af66fc99e Initial load
duke
parents:
diff changeset
280 );
a61af66fc99e Initial load
duke
parents:
diff changeset
281 }
a61af66fc99e Initial load
duke
parents:
diff changeset
282 inline void update_initial_pause_young_slope_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
283 _initial_pause_young_slope_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
284 (jlong)(cms_size_policy()->initial_pause_young_slope() * 1000)
a61af66fc99e Initial load
duke
parents:
diff changeset
285 );
a61af66fc99e Initial load
duke
parents:
diff changeset
286 }
a61af66fc99e Initial load
duke
parents:
diff changeset
287 inline void update_change_young_gen_for_maj_pauses() {
a61af66fc99e Initial load
duke
parents:
diff changeset
288 _change_young_gen_for_maj_pauses_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
289 cms_size_policy()->change_young_gen_for_maj_pauses());
a61af66fc99e Initial load
duke
parents:
diff changeset
290 }
a61af66fc99e Initial load
duke
parents:
diff changeset
291
a61af66fc99e Initial load
duke
parents:
diff changeset
292 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
293 CMSGCAdaptivePolicyCounters(const char* name, int collectors, int generations,
a61af66fc99e Initial load
duke
parents:
diff changeset
294 AdaptiveSizePolicy* size_policy);
a61af66fc99e Initial load
duke
parents:
diff changeset
295
a61af66fc99e Initial load
duke
parents:
diff changeset
296 // update counters
a61af66fc99e Initial load
duke
parents:
diff changeset
297 void update_counters();
a61af66fc99e Initial load
duke
parents:
diff changeset
298 void update_counters(CMSGCStats* gc_stats);
a61af66fc99e Initial load
duke
parents:
diff changeset
299 void update_counters_from_policy();
a61af66fc99e Initial load
duke
parents:
diff changeset
300
a61af66fc99e Initial load
duke
parents:
diff changeset
301 inline void update_cms_capacity_counter(size_t size_in_bytes) {
a61af66fc99e Initial load
duke
parents:
diff changeset
302 _cms_capacity_counter->set_value(size_in_bytes);
a61af66fc99e Initial load
duke
parents:
diff changeset
303 }
a61af66fc99e Initial load
duke
parents:
diff changeset
304
a61af66fc99e Initial load
duke
parents:
diff changeset
305 virtual GCPolicyCounters::Name kind() const {
a61af66fc99e Initial load
duke
parents:
diff changeset
306 return GCPolicyCounters::CMSGCAdaptivePolicyCountersKind;
a61af66fc99e Initial load
duke
parents:
diff changeset
307 }
a61af66fc99e Initial load
duke
parents:
diff changeset
308 };
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
309
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
310 #endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSGCADAPTIVEPOLICYCOUNTERS_HPP