Mercurial > hg > graal-compiler
annotate src/share/vm/gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.cpp @ 9152:f36e073d56a4
7104565: trim jprt build targets
Summary: remove JPRT debug builds, remove -DDEBUG -DFASTDEBUG and use ASSERT instead in sources
Reviewed-by: dholmes, kvn, coleenp
author | drchase |
---|---|
date | Fri, 12 Apr 2013 15:53:30 -0700 |
parents | f95d63e2154a |
children |
rev | line source |
---|---|
0 | 1 /* |
1972 | 2 * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. |
0 | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | |
5 * This code is free software; you can redistribute it and/or modify it | |
6 * under the terms of the GNU General Public License version 2 only, as | |
7 * published by the Free Software Foundation. | |
8 * | |
9 * This code is distributed in the hope that it will be useful, but WITHOUT | |
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
12 * version 2 for more details (a copy is included in the LICENSE file that | |
13 * accompanied this code). | |
14 * | |
15 * You should have received a copy of the GNU General Public License version | |
16 * 2 along with this work; if not, write to the Free Software Foundation, | |
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
18 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
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:
0
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
1972 | 25 #include "precompiled.hpp" |
26 #include "gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.hpp" | |
27 #include "memory/resourceArea.hpp" | |
0 | 28 |
29 CMSGCAdaptivePolicyCounters::CMSGCAdaptivePolicyCounters(const char* name_arg, | |
30 int collectors, | |
31 int generations, | |
32 AdaptiveSizePolicy* size_policy_arg) | |
33 : GCAdaptivePolicyCounters(name_arg, | |
34 collectors, | |
35 generations, | |
36 size_policy_arg) { | |
37 if (UsePerfData) { | |
38 EXCEPTION_MARK; | |
39 ResourceMark rm; | |
40 | |
41 const char* cname = | |
42 PerfDataManager::counter_name(name_space(), "cmsCapacity"); | |
43 _cms_capacity_counter = PerfDataManager::create_variable(SUN_GC, cname, | |
44 PerfData::U_Bytes, (jlong) OldSize, CHECK); | |
45 #ifdef NOT_PRODUCT | |
46 cname = | |
47 PerfDataManager::counter_name(name_space(), "initialPause"); | |
48 _initial_pause_counter = PerfDataManager::create_variable(SUN_GC, cname, | |
49 PerfData::U_Ticks, | |
50 (jlong) cms_size_policy()->avg_initial_pause()->last_sample(), | |
51 CHECK); | |
52 | |
53 cname = PerfDataManager::counter_name(name_space(), "remarkPause"); | |
54 _remark_pause_counter = PerfDataManager::create_variable(SUN_GC, cname, | |
55 PerfData::U_Ticks, | |
56 (jlong) cms_size_policy()->avg_remark_pause()->last_sample(), | |
57 CHECK); | |
58 #endif | |
59 cname = | |
60 PerfDataManager::counter_name(name_space(), "avgInitialPause"); | |
61 _avg_initial_pause_counter = PerfDataManager::create_variable(SUN_GC, cname, | |
62 PerfData::U_Ticks, | |
63 (jlong) cms_size_policy()->avg_initial_pause()->average(), | |
64 CHECK); | |
65 | |
66 cname = PerfDataManager::counter_name(name_space(), "avgRemarkPause"); | |
67 _avg_remark_pause_counter = PerfDataManager::create_variable(SUN_GC, cname, | |
68 PerfData::U_Ticks, | |
69 (jlong) cms_size_policy()->avg_remark_pause()->average(), | |
70 CHECK); | |
71 | |
72 cname = PerfDataManager::counter_name(name_space(), "avgSTWGcCost"); | |
73 _avg_cms_STW_gc_cost_counter = PerfDataManager::create_variable(SUN_GC, | |
74 cname, | |
75 PerfData::U_Ticks, | |
76 (jlong) cms_size_policy()->avg_cms_STW_gc_cost()->average(), | |
77 CHECK); | |
78 | |
79 cname = PerfDataManager::counter_name(name_space(), "avgSTWTime"); | |
80 _avg_cms_STW_time_counter = PerfDataManager::create_variable(SUN_GC, | |
81 cname, | |
82 PerfData::U_Ticks, | |
83 (jlong) cms_size_policy()->avg_cms_STW_time()->average(), | |
84 CHECK); | |
85 | |
86 | |
87 cname = PerfDataManager::counter_name(name_space(), "avgConcurrentTime"); | |
88 _avg_concurrent_time_counter = PerfDataManager::create_variable(SUN_GC, | |
89 cname, | |
90 PerfData::U_Ticks, | |
91 (jlong) cms_size_policy()->avg_concurrent_time()->average(), | |
92 CHECK); | |
93 | |
94 cname = | |
95 PerfDataManager::counter_name(name_space(), "avgConcurrentInterval"); | |
96 _avg_concurrent_interval_counter = PerfDataManager::create_variable(SUN_GC, | |
97 cname, | |
98 PerfData::U_Ticks, | |
99 (jlong) cms_size_policy()->avg_concurrent_interval()->average(), | |
100 CHECK); | |
101 | |
102 cname = PerfDataManager::counter_name(name_space(), "avgConcurrentGcCost"); | |
103 _avg_concurrent_gc_cost_counter = PerfDataManager::create_variable(SUN_GC, | |
104 cname, | |
105 PerfData::U_Ticks, | |
106 (jlong) cms_size_policy()->avg_concurrent_gc_cost()->average(), | |
107 CHECK); | |
108 | |
109 cname = PerfDataManager::counter_name(name_space(), "avgCMSFreeAtSweep"); | |
110 _avg_cms_free_at_sweep_counter = PerfDataManager::create_variable(SUN_GC, | |
111 cname, | |
112 PerfData::U_Ticks, | |
113 (jlong) cms_size_policy()->avg_cms_free_at_sweep()->average(), | |
114 CHECK); | |
115 | |
116 cname = PerfDataManager::counter_name(name_space(), "avgCMSFree"); | |
117 _avg_cms_free_counter = PerfDataManager::create_variable(SUN_GC, | |
118 cname, | |
119 PerfData::U_Ticks, | |
120 (jlong) cms_size_policy()->avg_cms_free()->average(), | |
121 CHECK); | |
122 | |
123 cname = PerfDataManager::counter_name(name_space(), "avgCMSPromo"); | |
124 _avg_cms_promo_counter = PerfDataManager::create_variable(SUN_GC, | |
125 cname, | |
126 PerfData::U_Ticks, | |
127 (jlong) cms_size_policy()->avg_cms_promo()->average(), | |
128 CHECK); | |
129 | |
130 cname = PerfDataManager::counter_name(name_space(), "avgMscPause"); | |
131 _avg_msc_pause_counter = PerfDataManager::create_variable(SUN_GC, | |
132 cname, | |
133 PerfData::U_Ticks, | |
134 (jlong) cms_size_policy()->avg_msc_pause()->average(), | |
135 CHECK); | |
136 | |
137 cname = PerfDataManager::counter_name(name_space(), "avgMscInterval"); | |
138 _avg_msc_interval_counter = PerfDataManager::create_variable(SUN_GC, | |
139 cname, | |
140 PerfData::U_Ticks, | |
141 (jlong) cms_size_policy()->avg_msc_interval()->average(), | |
142 CHECK); | |
143 | |
144 cname = PerfDataManager::counter_name(name_space(), "mscGcCost"); | |
145 _msc_gc_cost_counter = PerfDataManager::create_variable(SUN_GC, | |
146 cname, | |
147 PerfData::U_Ticks, | |
148 (jlong) cms_size_policy()->avg_msc_gc_cost()->average(), | |
149 CHECK); | |
150 | |
151 cname = PerfDataManager::counter_name(name_space(), "avgMsPause"); | |
152 _avg_ms_pause_counter = PerfDataManager::create_variable(SUN_GC, | |
153 cname, | |
154 PerfData::U_Ticks, | |
155 (jlong) cms_size_policy()->avg_ms_pause()->average(), | |
156 CHECK); | |
157 | |
158 cname = PerfDataManager::counter_name(name_space(), "avgMsInterval"); | |
159 _avg_ms_interval_counter = PerfDataManager::create_variable(SUN_GC, | |
160 cname, | |
161 PerfData::U_Ticks, | |
162 (jlong) cms_size_policy()->avg_ms_interval()->average(), | |
163 CHECK); | |
164 | |
165 cname = PerfDataManager::counter_name(name_space(), "msGcCost"); | |
166 _ms_gc_cost_counter = PerfDataManager::create_variable(SUN_GC, | |
167 cname, | |
168 PerfData::U_Ticks, | |
169 (jlong) cms_size_policy()->avg_ms_gc_cost()->average(), | |
170 CHECK); | |
171 | |
172 cname = PerfDataManager::counter_name(name_space(), "majorGcCost"); | |
173 _major_gc_cost_counter = PerfDataManager::create_variable(SUN_GC, cname, | |
174 PerfData::U_Ticks, (jlong) cms_size_policy()->cms_gc_cost(), CHECK); | |
175 | |
176 cname = PerfDataManager::counter_name(name_space(), "avgPromotedAvg"); | |
177 _promoted_avg_counter = | |
178 PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Bytes, | |
179 cms_size_policy()->calculated_promo_size_in_bytes(), CHECK); | |
180 | |
181 cname = PerfDataManager::counter_name(name_space(), "avgPromotedDev"); | |
182 _promoted_avg_dev_counter = | |
183 PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Bytes, | |
184 (jlong) 0 , CHECK); | |
185 | |
186 cname = PerfDataManager::counter_name(name_space(), "avgPromotedPaddedAvg"); | |
187 _promoted_padded_avg_counter = | |
188 PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Bytes, | |
189 cms_size_policy()->calculated_promo_size_in_bytes(), CHECK); | |
190 | |
191 cname = PerfDataManager::counter_name(name_space(), | |
192 "changeYoungGenForMajPauses"); | |
193 _change_young_gen_for_maj_pauses_counter = | |
194 PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Events, | |
195 (jlong)0, CHECK); | |
196 | |
197 cname = PerfDataManager::counter_name(name_space(), "remarkPauseOldSlope"); | |
198 _remark_pause_old_slope_counter = | |
199 PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Bytes, | |
200 (jlong) cms_size_policy()->remark_pause_old_slope(), CHECK); | |
201 | |
202 cname = PerfDataManager::counter_name(name_space(), "initialPauseOldSlope"); | |
203 _initial_pause_old_slope_counter = | |
204 PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Bytes, | |
205 (jlong) cms_size_policy()->initial_pause_old_slope(), CHECK); | |
206 | |
207 cname = | |
208 PerfDataManager::counter_name(name_space(), "remarkPauseYoungSlope") ; | |
209 _remark_pause_young_slope_counter = | |
210 PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Bytes, | |
211 (jlong) cms_size_policy()->remark_pause_young_slope(), CHECK); | |
212 | |
213 cname = | |
214 PerfDataManager::counter_name(name_space(), "initialPauseYoungSlope"); | |
215 _initial_pause_young_slope_counter = | |
216 PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Bytes, | |
217 (jlong) cms_size_policy()->initial_pause_young_slope(), CHECK); | |
218 | |
219 | |
220 } | |
221 assert(size_policy()->is_gc_cms_adaptive_size_policy(), | |
222 "Wrong type of size policy"); | |
223 } | |
224 | |
225 void CMSGCAdaptivePolicyCounters::update_counters() { | |
226 if (UsePerfData) { | |
227 GCAdaptivePolicyCounters::update_counters_from_policy(); | |
228 update_counters_from_policy(); | |
229 } | |
230 } | |
231 | |
232 void CMSGCAdaptivePolicyCounters::update_counters(CMSGCStats* gc_stats) { | |
233 if (UsePerfData) { | |
234 update_counters(); | |
235 update_promoted((size_t) gc_stats->avg_promoted()->last_sample()); | |
236 update_avg_promoted_avg(gc_stats); | |
237 update_avg_promoted_dev(gc_stats); | |
238 update_avg_promoted_padded_avg(gc_stats); | |
239 } | |
240 } | |
241 | |
242 void CMSGCAdaptivePolicyCounters::update_counters_from_policy() { | |
243 if (UsePerfData && (cms_size_policy() != NULL)) { | |
244 | |
245 GCAdaptivePolicyCounters::update_counters_from_policy(); | |
246 | |
247 update_major_gc_cost_counter(); | |
248 update_mutator_cost_counter(); | |
249 | |
250 update_eden_size(); | |
251 update_promo_size(); | |
252 | |
253 // If these updates from the last_sample() work, | |
254 // revise the update methods for these counters | |
255 // (both here and in PS). | |
256 update_survived((size_t) cms_size_policy()->avg_survived()->last_sample()); | |
257 | |
258 update_avg_concurrent_time_counter(); | |
259 update_avg_concurrent_interval_counter(); | |
260 update_avg_concurrent_gc_cost_counter(); | |
261 #ifdef NOT_PRODUCT | |
262 update_initial_pause_counter(); | |
263 update_remark_pause_counter(); | |
264 #endif | |
265 update_avg_initial_pause_counter(); | |
266 update_avg_remark_pause_counter(); | |
267 | |
268 update_avg_cms_STW_time_counter(); | |
269 update_avg_cms_STW_gc_cost_counter(); | |
270 | |
271 update_avg_cms_free_counter(); | |
272 update_avg_cms_free_at_sweep_counter(); | |
273 update_avg_cms_promo_counter(); | |
274 | |
275 update_avg_msc_pause_counter(); | |
276 update_avg_msc_interval_counter(); | |
277 update_msc_gc_cost_counter(); | |
278 | |
279 update_avg_ms_pause_counter(); | |
280 update_avg_ms_interval_counter(); | |
281 update_ms_gc_cost_counter(); | |
282 | |
283 update_avg_old_live_counter(); | |
284 | |
285 update_survivor_size_counters(); | |
286 update_avg_survived_avg_counters(); | |
287 update_avg_survived_dev_counters(); | |
288 | |
289 update_decrement_tenuring_threshold_for_gc_cost(); | |
290 update_increment_tenuring_threshold_for_gc_cost(); | |
291 update_decrement_tenuring_threshold_for_survivor_limit(); | |
292 | |
293 update_change_young_gen_for_maj_pauses(); | |
294 | |
295 update_major_collection_slope_counter(); | |
296 update_remark_pause_old_slope_counter(); | |
297 update_initial_pause_old_slope_counter(); | |
298 update_remark_pause_young_slope_counter(); | |
299 update_initial_pause_young_slope_counter(); | |
300 | |
301 update_decide_at_full_gc_counter(); | |
302 } | |
303 } |