annotate src/share/vm/gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.cpp @ 1716:be3f9c242c9d

6948538: CMS: BOT walkers can fall into object allocation and initialization cracks Summary: GC workers now recognize an intermediate transient state of blocks which are allocated but have not yet completed initialization. blk_start() calls do not attempt to determine the size of a block in the transient state, rather waiting for the block to become initialized so that it is safe to query its size. Audited and ensured the order of initialization of object fields (klass, free bit and size) to respect block state transition protocol. Also included some new assertion checking code enabled in debug mode. Reviewed-by: chrisphi, johnc, poonam
author ysr
date Mon, 16 Aug 2010 15:58:42 -0700
parents c18cbe5936b8
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: 0
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: 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
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 # include "incls/_precompiled.incl"
a61af66fc99e Initial load
duke
parents:
diff changeset
26 # include "incls/_cmsGCAdaptivePolicyCounters.cpp.incl"
a61af66fc99e Initial load
duke
parents:
diff changeset
27
a61af66fc99e Initial load
duke
parents:
diff changeset
28 CMSGCAdaptivePolicyCounters::CMSGCAdaptivePolicyCounters(const char* name_arg,
a61af66fc99e Initial load
duke
parents:
diff changeset
29 int collectors,
a61af66fc99e Initial load
duke
parents:
diff changeset
30 int generations,
a61af66fc99e Initial load
duke
parents:
diff changeset
31 AdaptiveSizePolicy* size_policy_arg)
a61af66fc99e Initial load
duke
parents:
diff changeset
32 : GCAdaptivePolicyCounters(name_arg,
a61af66fc99e Initial load
duke
parents:
diff changeset
33 collectors,
a61af66fc99e Initial load
duke
parents:
diff changeset
34 generations,
a61af66fc99e Initial load
duke
parents:
diff changeset
35 size_policy_arg) {
a61af66fc99e Initial load
duke
parents:
diff changeset
36 if (UsePerfData) {
a61af66fc99e Initial load
duke
parents:
diff changeset
37 EXCEPTION_MARK;
a61af66fc99e Initial load
duke
parents:
diff changeset
38 ResourceMark rm;
a61af66fc99e Initial load
duke
parents:
diff changeset
39
a61af66fc99e Initial load
duke
parents:
diff changeset
40 const char* cname =
a61af66fc99e Initial load
duke
parents:
diff changeset
41 PerfDataManager::counter_name(name_space(), "cmsCapacity");
a61af66fc99e Initial load
duke
parents:
diff changeset
42 _cms_capacity_counter = PerfDataManager::create_variable(SUN_GC, cname,
a61af66fc99e Initial load
duke
parents:
diff changeset
43 PerfData::U_Bytes, (jlong) OldSize, CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
44 #ifdef NOT_PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
45 cname =
a61af66fc99e Initial load
duke
parents:
diff changeset
46 PerfDataManager::counter_name(name_space(), "initialPause");
a61af66fc99e Initial load
duke
parents:
diff changeset
47 _initial_pause_counter = PerfDataManager::create_variable(SUN_GC, cname,
a61af66fc99e Initial load
duke
parents:
diff changeset
48 PerfData::U_Ticks,
a61af66fc99e Initial load
duke
parents:
diff changeset
49 (jlong) cms_size_policy()->avg_initial_pause()->last_sample(),
a61af66fc99e Initial load
duke
parents:
diff changeset
50 CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
51
a61af66fc99e Initial load
duke
parents:
diff changeset
52 cname = PerfDataManager::counter_name(name_space(), "remarkPause");
a61af66fc99e Initial load
duke
parents:
diff changeset
53 _remark_pause_counter = PerfDataManager::create_variable(SUN_GC, cname,
a61af66fc99e Initial load
duke
parents:
diff changeset
54 PerfData::U_Ticks,
a61af66fc99e Initial load
duke
parents:
diff changeset
55 (jlong) cms_size_policy()->avg_remark_pause()->last_sample(),
a61af66fc99e Initial load
duke
parents:
diff changeset
56 CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
57 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
58 cname =
a61af66fc99e Initial load
duke
parents:
diff changeset
59 PerfDataManager::counter_name(name_space(), "avgInitialPause");
a61af66fc99e Initial load
duke
parents:
diff changeset
60 _avg_initial_pause_counter = PerfDataManager::create_variable(SUN_GC, cname,
a61af66fc99e Initial load
duke
parents:
diff changeset
61 PerfData::U_Ticks,
a61af66fc99e Initial load
duke
parents:
diff changeset
62 (jlong) cms_size_policy()->avg_initial_pause()->average(),
a61af66fc99e Initial load
duke
parents:
diff changeset
63 CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
64
a61af66fc99e Initial load
duke
parents:
diff changeset
65 cname = PerfDataManager::counter_name(name_space(), "avgRemarkPause");
a61af66fc99e Initial load
duke
parents:
diff changeset
66 _avg_remark_pause_counter = PerfDataManager::create_variable(SUN_GC, cname,
a61af66fc99e Initial load
duke
parents:
diff changeset
67 PerfData::U_Ticks,
a61af66fc99e Initial load
duke
parents:
diff changeset
68 (jlong) cms_size_policy()->avg_remark_pause()->average(),
a61af66fc99e Initial load
duke
parents:
diff changeset
69 CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
70
a61af66fc99e Initial load
duke
parents:
diff changeset
71 cname = PerfDataManager::counter_name(name_space(), "avgSTWGcCost");
a61af66fc99e Initial load
duke
parents:
diff changeset
72 _avg_cms_STW_gc_cost_counter = PerfDataManager::create_variable(SUN_GC,
a61af66fc99e Initial load
duke
parents:
diff changeset
73 cname,
a61af66fc99e Initial load
duke
parents:
diff changeset
74 PerfData::U_Ticks,
a61af66fc99e Initial load
duke
parents:
diff changeset
75 (jlong) cms_size_policy()->avg_cms_STW_gc_cost()->average(),
a61af66fc99e Initial load
duke
parents:
diff changeset
76 CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
77
a61af66fc99e Initial load
duke
parents:
diff changeset
78 cname = PerfDataManager::counter_name(name_space(), "avgSTWTime");
a61af66fc99e Initial load
duke
parents:
diff changeset
79 _avg_cms_STW_time_counter = PerfDataManager::create_variable(SUN_GC,
a61af66fc99e Initial load
duke
parents:
diff changeset
80 cname,
a61af66fc99e Initial load
duke
parents:
diff changeset
81 PerfData::U_Ticks,
a61af66fc99e Initial load
duke
parents:
diff changeset
82 (jlong) cms_size_policy()->avg_cms_STW_time()->average(),
a61af66fc99e Initial load
duke
parents:
diff changeset
83 CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
84
a61af66fc99e Initial load
duke
parents:
diff changeset
85
a61af66fc99e Initial load
duke
parents:
diff changeset
86 cname = PerfDataManager::counter_name(name_space(), "avgConcurrentTime");
a61af66fc99e Initial load
duke
parents:
diff changeset
87 _avg_concurrent_time_counter = PerfDataManager::create_variable(SUN_GC,
a61af66fc99e Initial load
duke
parents:
diff changeset
88 cname,
a61af66fc99e Initial load
duke
parents:
diff changeset
89 PerfData::U_Ticks,
a61af66fc99e Initial load
duke
parents:
diff changeset
90 (jlong) cms_size_policy()->avg_concurrent_time()->average(),
a61af66fc99e Initial load
duke
parents:
diff changeset
91 CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
92
a61af66fc99e Initial load
duke
parents:
diff changeset
93 cname =
a61af66fc99e Initial load
duke
parents:
diff changeset
94 PerfDataManager::counter_name(name_space(), "avgConcurrentInterval");
a61af66fc99e Initial load
duke
parents:
diff changeset
95 _avg_concurrent_interval_counter = PerfDataManager::create_variable(SUN_GC,
a61af66fc99e Initial load
duke
parents:
diff changeset
96 cname,
a61af66fc99e Initial load
duke
parents:
diff changeset
97 PerfData::U_Ticks,
a61af66fc99e Initial load
duke
parents:
diff changeset
98 (jlong) cms_size_policy()->avg_concurrent_interval()->average(),
a61af66fc99e Initial load
duke
parents:
diff changeset
99 CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
100
a61af66fc99e Initial load
duke
parents:
diff changeset
101 cname = PerfDataManager::counter_name(name_space(), "avgConcurrentGcCost");
a61af66fc99e Initial load
duke
parents:
diff changeset
102 _avg_concurrent_gc_cost_counter = PerfDataManager::create_variable(SUN_GC,
a61af66fc99e Initial load
duke
parents:
diff changeset
103 cname,
a61af66fc99e Initial load
duke
parents:
diff changeset
104 PerfData::U_Ticks,
a61af66fc99e Initial load
duke
parents:
diff changeset
105 (jlong) cms_size_policy()->avg_concurrent_gc_cost()->average(),
a61af66fc99e Initial load
duke
parents:
diff changeset
106 CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
107
a61af66fc99e Initial load
duke
parents:
diff changeset
108 cname = PerfDataManager::counter_name(name_space(), "avgCMSFreeAtSweep");
a61af66fc99e Initial load
duke
parents:
diff changeset
109 _avg_cms_free_at_sweep_counter = PerfDataManager::create_variable(SUN_GC,
a61af66fc99e Initial load
duke
parents:
diff changeset
110 cname,
a61af66fc99e Initial load
duke
parents:
diff changeset
111 PerfData::U_Ticks,
a61af66fc99e Initial load
duke
parents:
diff changeset
112 (jlong) cms_size_policy()->avg_cms_free_at_sweep()->average(),
a61af66fc99e Initial load
duke
parents:
diff changeset
113 CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
114
a61af66fc99e Initial load
duke
parents:
diff changeset
115 cname = PerfDataManager::counter_name(name_space(), "avgCMSFree");
a61af66fc99e Initial load
duke
parents:
diff changeset
116 _avg_cms_free_counter = PerfDataManager::create_variable(SUN_GC,
a61af66fc99e Initial load
duke
parents:
diff changeset
117 cname,
a61af66fc99e Initial load
duke
parents:
diff changeset
118 PerfData::U_Ticks,
a61af66fc99e Initial load
duke
parents:
diff changeset
119 (jlong) cms_size_policy()->avg_cms_free()->average(),
a61af66fc99e Initial load
duke
parents:
diff changeset
120 CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
121
a61af66fc99e Initial load
duke
parents:
diff changeset
122 cname = PerfDataManager::counter_name(name_space(), "avgCMSPromo");
a61af66fc99e Initial load
duke
parents:
diff changeset
123 _avg_cms_promo_counter = PerfDataManager::create_variable(SUN_GC,
a61af66fc99e Initial load
duke
parents:
diff changeset
124 cname,
a61af66fc99e Initial load
duke
parents:
diff changeset
125 PerfData::U_Ticks,
a61af66fc99e Initial load
duke
parents:
diff changeset
126 (jlong) cms_size_policy()->avg_cms_promo()->average(),
a61af66fc99e Initial load
duke
parents:
diff changeset
127 CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
128
a61af66fc99e Initial load
duke
parents:
diff changeset
129 cname = PerfDataManager::counter_name(name_space(), "avgMscPause");
a61af66fc99e Initial load
duke
parents:
diff changeset
130 _avg_msc_pause_counter = PerfDataManager::create_variable(SUN_GC,
a61af66fc99e Initial load
duke
parents:
diff changeset
131 cname,
a61af66fc99e Initial load
duke
parents:
diff changeset
132 PerfData::U_Ticks,
a61af66fc99e Initial load
duke
parents:
diff changeset
133 (jlong) cms_size_policy()->avg_msc_pause()->average(),
a61af66fc99e Initial load
duke
parents:
diff changeset
134 CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
135
a61af66fc99e Initial load
duke
parents:
diff changeset
136 cname = PerfDataManager::counter_name(name_space(), "avgMscInterval");
a61af66fc99e Initial load
duke
parents:
diff changeset
137 _avg_msc_interval_counter = PerfDataManager::create_variable(SUN_GC,
a61af66fc99e Initial load
duke
parents:
diff changeset
138 cname,
a61af66fc99e Initial load
duke
parents:
diff changeset
139 PerfData::U_Ticks,
a61af66fc99e Initial load
duke
parents:
diff changeset
140 (jlong) cms_size_policy()->avg_msc_interval()->average(),
a61af66fc99e Initial load
duke
parents:
diff changeset
141 CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
142
a61af66fc99e Initial load
duke
parents:
diff changeset
143 cname = PerfDataManager::counter_name(name_space(), "mscGcCost");
a61af66fc99e Initial load
duke
parents:
diff changeset
144 _msc_gc_cost_counter = PerfDataManager::create_variable(SUN_GC,
a61af66fc99e Initial load
duke
parents:
diff changeset
145 cname,
a61af66fc99e Initial load
duke
parents:
diff changeset
146 PerfData::U_Ticks,
a61af66fc99e Initial load
duke
parents:
diff changeset
147 (jlong) cms_size_policy()->avg_msc_gc_cost()->average(),
a61af66fc99e Initial load
duke
parents:
diff changeset
148 CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
149
a61af66fc99e Initial load
duke
parents:
diff changeset
150 cname = PerfDataManager::counter_name(name_space(), "avgMsPause");
a61af66fc99e Initial load
duke
parents:
diff changeset
151 _avg_ms_pause_counter = PerfDataManager::create_variable(SUN_GC,
a61af66fc99e Initial load
duke
parents:
diff changeset
152 cname,
a61af66fc99e Initial load
duke
parents:
diff changeset
153 PerfData::U_Ticks,
a61af66fc99e Initial load
duke
parents:
diff changeset
154 (jlong) cms_size_policy()->avg_ms_pause()->average(),
a61af66fc99e Initial load
duke
parents:
diff changeset
155 CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
156
a61af66fc99e Initial load
duke
parents:
diff changeset
157 cname = PerfDataManager::counter_name(name_space(), "avgMsInterval");
a61af66fc99e Initial load
duke
parents:
diff changeset
158 _avg_ms_interval_counter = PerfDataManager::create_variable(SUN_GC,
a61af66fc99e Initial load
duke
parents:
diff changeset
159 cname,
a61af66fc99e Initial load
duke
parents:
diff changeset
160 PerfData::U_Ticks,
a61af66fc99e Initial load
duke
parents:
diff changeset
161 (jlong) cms_size_policy()->avg_ms_interval()->average(),
a61af66fc99e Initial load
duke
parents:
diff changeset
162 CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
163
a61af66fc99e Initial load
duke
parents:
diff changeset
164 cname = PerfDataManager::counter_name(name_space(), "msGcCost");
a61af66fc99e Initial load
duke
parents:
diff changeset
165 _ms_gc_cost_counter = PerfDataManager::create_variable(SUN_GC,
a61af66fc99e Initial load
duke
parents:
diff changeset
166 cname,
a61af66fc99e Initial load
duke
parents:
diff changeset
167 PerfData::U_Ticks,
a61af66fc99e Initial load
duke
parents:
diff changeset
168 (jlong) cms_size_policy()->avg_ms_gc_cost()->average(),
a61af66fc99e Initial load
duke
parents:
diff changeset
169 CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
170
a61af66fc99e Initial load
duke
parents:
diff changeset
171 cname = PerfDataManager::counter_name(name_space(), "majorGcCost");
a61af66fc99e Initial load
duke
parents:
diff changeset
172 _major_gc_cost_counter = PerfDataManager::create_variable(SUN_GC, cname,
a61af66fc99e Initial load
duke
parents:
diff changeset
173 PerfData::U_Ticks, (jlong) cms_size_policy()->cms_gc_cost(), CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
174
a61af66fc99e Initial load
duke
parents:
diff changeset
175 cname = PerfDataManager::counter_name(name_space(), "avgPromotedAvg");
a61af66fc99e Initial load
duke
parents:
diff changeset
176 _promoted_avg_counter =
a61af66fc99e Initial load
duke
parents:
diff changeset
177 PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Bytes,
a61af66fc99e Initial load
duke
parents:
diff changeset
178 cms_size_policy()->calculated_promo_size_in_bytes(), CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
179
a61af66fc99e Initial load
duke
parents:
diff changeset
180 cname = PerfDataManager::counter_name(name_space(), "avgPromotedDev");
a61af66fc99e Initial load
duke
parents:
diff changeset
181 _promoted_avg_dev_counter =
a61af66fc99e Initial load
duke
parents:
diff changeset
182 PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Bytes,
a61af66fc99e Initial load
duke
parents:
diff changeset
183 (jlong) 0 , CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
184
a61af66fc99e Initial load
duke
parents:
diff changeset
185 cname = PerfDataManager::counter_name(name_space(), "avgPromotedPaddedAvg");
a61af66fc99e Initial load
duke
parents:
diff changeset
186 _promoted_padded_avg_counter =
a61af66fc99e Initial load
duke
parents:
diff changeset
187 PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Bytes,
a61af66fc99e Initial load
duke
parents:
diff changeset
188 cms_size_policy()->calculated_promo_size_in_bytes(), CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
189
a61af66fc99e Initial load
duke
parents:
diff changeset
190 cname = PerfDataManager::counter_name(name_space(),
a61af66fc99e Initial load
duke
parents:
diff changeset
191 "changeYoungGenForMajPauses");
a61af66fc99e Initial load
duke
parents:
diff changeset
192 _change_young_gen_for_maj_pauses_counter =
a61af66fc99e Initial load
duke
parents:
diff changeset
193 PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Events,
a61af66fc99e Initial load
duke
parents:
diff changeset
194 (jlong)0, CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
195
a61af66fc99e Initial load
duke
parents:
diff changeset
196 cname = PerfDataManager::counter_name(name_space(), "remarkPauseOldSlope");
a61af66fc99e Initial load
duke
parents:
diff changeset
197 _remark_pause_old_slope_counter =
a61af66fc99e Initial load
duke
parents:
diff changeset
198 PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Bytes,
a61af66fc99e Initial load
duke
parents:
diff changeset
199 (jlong) cms_size_policy()->remark_pause_old_slope(), CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
200
a61af66fc99e Initial load
duke
parents:
diff changeset
201 cname = PerfDataManager::counter_name(name_space(), "initialPauseOldSlope");
a61af66fc99e Initial load
duke
parents:
diff changeset
202 _initial_pause_old_slope_counter =
a61af66fc99e Initial load
duke
parents:
diff changeset
203 PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Bytes,
a61af66fc99e Initial load
duke
parents:
diff changeset
204 (jlong) cms_size_policy()->initial_pause_old_slope(), CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
205
a61af66fc99e Initial load
duke
parents:
diff changeset
206 cname =
a61af66fc99e Initial load
duke
parents:
diff changeset
207 PerfDataManager::counter_name(name_space(), "remarkPauseYoungSlope") ;
a61af66fc99e Initial load
duke
parents:
diff changeset
208 _remark_pause_young_slope_counter =
a61af66fc99e Initial load
duke
parents:
diff changeset
209 PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Bytes,
a61af66fc99e Initial load
duke
parents:
diff changeset
210 (jlong) cms_size_policy()->remark_pause_young_slope(), CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
211
a61af66fc99e Initial load
duke
parents:
diff changeset
212 cname =
a61af66fc99e Initial load
duke
parents:
diff changeset
213 PerfDataManager::counter_name(name_space(), "initialPauseYoungSlope");
a61af66fc99e Initial load
duke
parents:
diff changeset
214 _initial_pause_young_slope_counter =
a61af66fc99e Initial load
duke
parents:
diff changeset
215 PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Bytes,
a61af66fc99e Initial load
duke
parents:
diff changeset
216 (jlong) cms_size_policy()->initial_pause_young_slope(), CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
217
a61af66fc99e Initial load
duke
parents:
diff changeset
218
a61af66fc99e Initial load
duke
parents:
diff changeset
219 }
a61af66fc99e Initial load
duke
parents:
diff changeset
220 assert(size_policy()->is_gc_cms_adaptive_size_policy(),
a61af66fc99e Initial load
duke
parents:
diff changeset
221 "Wrong type of size policy");
a61af66fc99e Initial load
duke
parents:
diff changeset
222 }
a61af66fc99e Initial load
duke
parents:
diff changeset
223
a61af66fc99e Initial load
duke
parents:
diff changeset
224 void CMSGCAdaptivePolicyCounters::update_counters() {
a61af66fc99e Initial load
duke
parents:
diff changeset
225 if (UsePerfData) {
a61af66fc99e Initial load
duke
parents:
diff changeset
226 GCAdaptivePolicyCounters::update_counters_from_policy();
a61af66fc99e Initial load
duke
parents:
diff changeset
227 update_counters_from_policy();
a61af66fc99e Initial load
duke
parents:
diff changeset
228 }
a61af66fc99e Initial load
duke
parents:
diff changeset
229 }
a61af66fc99e Initial load
duke
parents:
diff changeset
230
a61af66fc99e Initial load
duke
parents:
diff changeset
231 void CMSGCAdaptivePolicyCounters::update_counters(CMSGCStats* gc_stats) {
a61af66fc99e Initial load
duke
parents:
diff changeset
232 if (UsePerfData) {
a61af66fc99e Initial load
duke
parents:
diff changeset
233 update_counters();
a61af66fc99e Initial load
duke
parents:
diff changeset
234 update_promoted((size_t) gc_stats->avg_promoted()->last_sample());
a61af66fc99e Initial load
duke
parents:
diff changeset
235 update_avg_promoted_avg(gc_stats);
a61af66fc99e Initial load
duke
parents:
diff changeset
236 update_avg_promoted_dev(gc_stats);
a61af66fc99e Initial load
duke
parents:
diff changeset
237 update_avg_promoted_padded_avg(gc_stats);
a61af66fc99e Initial load
duke
parents:
diff changeset
238 }
a61af66fc99e Initial load
duke
parents:
diff changeset
239 }
a61af66fc99e Initial load
duke
parents:
diff changeset
240
a61af66fc99e Initial load
duke
parents:
diff changeset
241 void CMSGCAdaptivePolicyCounters::update_counters_from_policy() {
a61af66fc99e Initial load
duke
parents:
diff changeset
242 if (UsePerfData && (cms_size_policy() != NULL)) {
a61af66fc99e Initial load
duke
parents:
diff changeset
243
a61af66fc99e Initial load
duke
parents:
diff changeset
244 GCAdaptivePolicyCounters::update_counters_from_policy();
a61af66fc99e Initial load
duke
parents:
diff changeset
245
a61af66fc99e Initial load
duke
parents:
diff changeset
246 update_major_gc_cost_counter();
a61af66fc99e Initial load
duke
parents:
diff changeset
247 update_mutator_cost_counter();
a61af66fc99e Initial load
duke
parents:
diff changeset
248
a61af66fc99e Initial load
duke
parents:
diff changeset
249 update_eden_size();
a61af66fc99e Initial load
duke
parents:
diff changeset
250 update_promo_size();
a61af66fc99e Initial load
duke
parents:
diff changeset
251
a61af66fc99e Initial load
duke
parents:
diff changeset
252 // If these updates from the last_sample() work,
a61af66fc99e Initial load
duke
parents:
diff changeset
253 // revise the update methods for these counters
a61af66fc99e Initial load
duke
parents:
diff changeset
254 // (both here and in PS).
a61af66fc99e Initial load
duke
parents:
diff changeset
255 update_survived((size_t) cms_size_policy()->avg_survived()->last_sample());
a61af66fc99e Initial load
duke
parents:
diff changeset
256
a61af66fc99e Initial load
duke
parents:
diff changeset
257 update_avg_concurrent_time_counter();
a61af66fc99e Initial load
duke
parents:
diff changeset
258 update_avg_concurrent_interval_counter();
a61af66fc99e Initial load
duke
parents:
diff changeset
259 update_avg_concurrent_gc_cost_counter();
a61af66fc99e Initial load
duke
parents:
diff changeset
260 #ifdef NOT_PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
261 update_initial_pause_counter();
a61af66fc99e Initial load
duke
parents:
diff changeset
262 update_remark_pause_counter();
a61af66fc99e Initial load
duke
parents:
diff changeset
263 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
264 update_avg_initial_pause_counter();
a61af66fc99e Initial load
duke
parents:
diff changeset
265 update_avg_remark_pause_counter();
a61af66fc99e Initial load
duke
parents:
diff changeset
266
a61af66fc99e Initial load
duke
parents:
diff changeset
267 update_avg_cms_STW_time_counter();
a61af66fc99e Initial load
duke
parents:
diff changeset
268 update_avg_cms_STW_gc_cost_counter();
a61af66fc99e Initial load
duke
parents:
diff changeset
269
a61af66fc99e Initial load
duke
parents:
diff changeset
270 update_avg_cms_free_counter();
a61af66fc99e Initial load
duke
parents:
diff changeset
271 update_avg_cms_free_at_sweep_counter();
a61af66fc99e Initial load
duke
parents:
diff changeset
272 update_avg_cms_promo_counter();
a61af66fc99e Initial load
duke
parents:
diff changeset
273
a61af66fc99e Initial load
duke
parents:
diff changeset
274 update_avg_msc_pause_counter();
a61af66fc99e Initial load
duke
parents:
diff changeset
275 update_avg_msc_interval_counter();
a61af66fc99e Initial load
duke
parents:
diff changeset
276 update_msc_gc_cost_counter();
a61af66fc99e Initial load
duke
parents:
diff changeset
277
a61af66fc99e Initial load
duke
parents:
diff changeset
278 update_avg_ms_pause_counter();
a61af66fc99e Initial load
duke
parents:
diff changeset
279 update_avg_ms_interval_counter();
a61af66fc99e Initial load
duke
parents:
diff changeset
280 update_ms_gc_cost_counter();
a61af66fc99e Initial load
duke
parents:
diff changeset
281
a61af66fc99e Initial load
duke
parents:
diff changeset
282 update_avg_old_live_counter();
a61af66fc99e Initial load
duke
parents:
diff changeset
283
a61af66fc99e Initial load
duke
parents:
diff changeset
284 update_survivor_size_counters();
a61af66fc99e Initial load
duke
parents:
diff changeset
285 update_avg_survived_avg_counters();
a61af66fc99e Initial load
duke
parents:
diff changeset
286 update_avg_survived_dev_counters();
a61af66fc99e Initial load
duke
parents:
diff changeset
287
a61af66fc99e Initial load
duke
parents:
diff changeset
288 update_decrement_tenuring_threshold_for_gc_cost();
a61af66fc99e Initial load
duke
parents:
diff changeset
289 update_increment_tenuring_threshold_for_gc_cost();
a61af66fc99e Initial load
duke
parents:
diff changeset
290 update_decrement_tenuring_threshold_for_survivor_limit();
a61af66fc99e Initial load
duke
parents:
diff changeset
291
a61af66fc99e Initial load
duke
parents:
diff changeset
292 update_change_young_gen_for_maj_pauses();
a61af66fc99e Initial load
duke
parents:
diff changeset
293
a61af66fc99e Initial load
duke
parents:
diff changeset
294 update_major_collection_slope_counter();
a61af66fc99e Initial load
duke
parents:
diff changeset
295 update_remark_pause_old_slope_counter();
a61af66fc99e Initial load
duke
parents:
diff changeset
296 update_initial_pause_old_slope_counter();
a61af66fc99e Initial load
duke
parents:
diff changeset
297 update_remark_pause_young_slope_counter();
a61af66fc99e Initial load
duke
parents:
diff changeset
298 update_initial_pause_young_slope_counter();
a61af66fc99e Initial load
duke
parents:
diff changeset
299
a61af66fc99e Initial load
duke
parents:
diff changeset
300 update_decide_at_full_gc_counter();
a61af66fc99e Initial load
duke
parents:
diff changeset
301 }
a61af66fc99e Initial load
duke
parents:
diff changeset
302 }