Mercurial > hg > truffle
annotate src/share/vm/gc_implementation/shared/gcAdaptivePolicyCounters.cpp @ 1951:899bbbdcb6ea
6997298: fatal error: must own lock CMS_markBitMap_lock during heap dump
Summary: Since we are at a stop-world pause, the existing CMS-phase checks are sufficient for safety, and the locking check can be safely elided. Elaborated documentation comment to the case where class unloading and verification are disabled, and the query happens when we aren't in the sweeping phase, where the answer "false" would be (almost everywhere) too pessimistic.
Reviewed-by: jmasa, johnc, tonyp
author | ysr |
---|---|
date | Fri, 05 Nov 2010 13:20:37 -0700 |
parents | c18cbe5936b8 |
children | f95d63e2154a |
rev | line source |
---|---|
0 | 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 | 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 | |
25 # include "incls/_precompiled.incl" | |
26 # include "incls/_gcAdaptivePolicyCounters.cpp.incl" | |
27 | |
28 // This class keeps statistical information and computes the | |
29 // size of the heap. | |
30 | |
31 GCAdaptivePolicyCounters::GCAdaptivePolicyCounters(const char* name, | |
32 int collectors, | |
33 int generations, | |
34 AdaptiveSizePolicy* size_policy_arg) | |
35 : GCPolicyCounters(name, collectors, generations), | |
36 _size_policy(size_policy_arg) { | |
37 if (UsePerfData) { | |
38 EXCEPTION_MARK; | |
39 ResourceMark rm; | |
40 | |
41 const char* cname = PerfDataManager::counter_name(name_space(), "edenSize"); | |
42 _eden_size_counter = PerfDataManager::create_variable(SUN_GC, cname, | |
43 PerfData::U_Bytes, _size_policy->calculated_eden_size_in_bytes(), CHECK); | |
44 | |
45 cname = PerfDataManager::counter_name(name_space(), "promoSize"); | |
46 _promo_size_counter = PerfDataManager::create_variable(SUN_GC, cname, | |
47 PerfData::U_Bytes, size_policy()->calculated_promo_size_in_bytes(), | |
48 CHECK); | |
49 | |
50 cname = PerfDataManager::counter_name(name_space(), "youngCapacity"); | |
51 size_t young_capacity_in_bytes = | |
52 _size_policy->calculated_eden_size_in_bytes() + | |
53 _size_policy->calculated_survivor_size_in_bytes(); | |
54 _young_capacity_counter = PerfDataManager::create_variable(SUN_GC, cname, | |
55 PerfData::U_Bytes, young_capacity_in_bytes, CHECK); | |
56 | |
57 cname = PerfDataManager::counter_name(name_space(), "avgSurvivedAvg"); | |
58 _avg_survived_avg_counter = PerfDataManager::create_variable(SUN_GC, cname, | |
59 PerfData::U_Bytes, size_policy()->calculated_survivor_size_in_bytes(), | |
60 CHECK); | |
61 | |
62 cname = PerfDataManager::counter_name(name_space(), "avgSurvivedDev"); | |
63 _avg_survived_dev_counter = PerfDataManager::create_variable(SUN_GC, cname, | |
64 PerfData::U_Bytes, (jlong) 0 , CHECK); | |
65 | |
66 cname = PerfDataManager::counter_name(name_space(), "avgSurvivedPaddedAvg"); | |
67 _avg_survived_padded_avg_counter = | |
68 PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Bytes, | |
69 size_policy()->calculated_survivor_size_in_bytes(), CHECK); | |
70 | |
71 cname = PerfDataManager::counter_name(name_space(), "avgMinorPauseTime"); | |
72 _avg_minor_pause_counter = PerfDataManager::create_variable(SUN_GC, cname, | |
73 PerfData::U_Ticks, (jlong) _size_policy->_avg_minor_pause->average(), | |
74 CHECK); | |
75 | |
76 cname = PerfDataManager::counter_name(name_space(), "avgMinorIntervalTime"); | |
77 _avg_minor_interval_counter = PerfDataManager::create_variable(SUN_GC, | |
78 cname, | |
79 PerfData::U_Ticks, | |
80 (jlong) _size_policy->_avg_minor_interval->average(), | |
81 CHECK); | |
82 | |
83 #ifdef NOT_PRODUCT | |
84 // This is a counter for the most recent minor pause time | |
85 // (the last sample, not the average). It is useful for | |
86 // verifying the average pause time but not worth putting | |
87 // into the product. | |
88 cname = PerfDataManager::counter_name(name_space(), "minorPauseTime"); | |
89 _minor_pause_counter = PerfDataManager::create_variable(SUN_GC, cname, | |
90 PerfData::U_Ticks, (jlong) _size_policy->_avg_minor_pause->last_sample(), | |
91 CHECK); | |
92 #endif | |
93 | |
94 cname = PerfDataManager::counter_name(name_space(), "minorGcCost"); | |
95 _minor_gc_cost_counter = PerfDataManager::create_variable(SUN_GC, | |
96 cname, | |
97 PerfData::U_Ticks, | |
98 (jlong) _size_policy->minor_gc_cost(), | |
99 CHECK); | |
100 | |
101 cname = PerfDataManager::counter_name(name_space(), "mutatorCost"); | |
102 _mutator_cost_counter = PerfDataManager::create_variable(SUN_GC, cname, | |
103 PerfData::U_Ticks, (jlong) _size_policy->mutator_cost(), CHECK); | |
104 | |
105 cname = PerfDataManager::counter_name(name_space(), "survived"); | |
106 _survived_counter = PerfDataManager::create_variable(SUN_GC, cname, | |
107 PerfData::U_Bytes, (jlong) 0, CHECK); | |
108 | |
109 cname = PerfDataManager::counter_name(name_space(), "promoted"); | |
110 _promoted_counter = PerfDataManager::create_variable(SUN_GC, cname, | |
111 PerfData::U_Bytes, (jlong) 0, CHECK); | |
112 | |
113 cname = PerfDataManager::counter_name(name_space(), "avgYoungLive"); | |
114 _avg_young_live_counter = PerfDataManager::create_variable(SUN_GC, cname, | |
115 PerfData::U_Bytes, (jlong) size_policy()->avg_young_live()->average(), | |
116 CHECK); | |
117 | |
118 cname = PerfDataManager::counter_name(name_space(), "avgOldLive"); | |
119 _avg_old_live_counter = PerfDataManager::create_variable(SUN_GC, cname, | |
120 PerfData::U_Bytes, (jlong) size_policy()->avg_old_live()->average(), | |
121 CHECK); | |
122 | |
123 cname = PerfDataManager::counter_name(name_space(), "survivorOverflowed"); | |
124 _survivor_overflowed_counter = PerfDataManager::create_variable(SUN_GC, cname, | |
125 PerfData::U_Events, (jlong)0, CHECK); | |
126 | |
127 cname = PerfDataManager::counter_name(name_space(), | |
128 "decrementTenuringThresholdForGcCost"); | |
129 _decrement_tenuring_threshold_for_gc_cost_counter = | |
130 PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Events, | |
131 (jlong)0, CHECK); | |
132 | |
133 cname = PerfDataManager::counter_name(name_space(), | |
134 "incrementTenuringThresholdForGcCost"); | |
135 _increment_tenuring_threshold_for_gc_cost_counter = | |
136 PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Events, | |
137 (jlong)0, CHECK); | |
138 | |
139 cname = PerfDataManager::counter_name(name_space(), | |
140 "decrementTenuringThresholdForSurvivorLimit"); | |
141 _decrement_tenuring_threshold_for_survivor_limit_counter = | |
142 PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Events, | |
143 (jlong)0, CHECK); | |
144 cname = PerfDataManager::counter_name(name_space(), | |
145 "changeYoungGenForMinPauses"); | |
146 _change_young_gen_for_min_pauses_counter = | |
147 PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Events, | |
148 (jlong)0, CHECK); | |
149 | |
150 cname = PerfDataManager::counter_name(name_space(), | |
151 "changeOldGenForMajPauses"); | |
152 _change_old_gen_for_maj_pauses_counter = | |
153 PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Events, | |
154 (jlong)0, CHECK); | |
155 | |
156 cname = PerfDataManager::counter_name(name_space(), | |
157 "increaseOldGenForThroughput"); | |
158 _change_old_gen_for_throughput_counter = | |
159 PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Events, | |
160 (jlong)0, CHECK); | |
161 | |
162 cname = PerfDataManager::counter_name(name_space(), | |
163 "increaseYoungGenForThroughput"); | |
164 _change_young_gen_for_throughput_counter = | |
165 PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Events, | |
166 (jlong)0, CHECK); | |
167 | |
168 cname = PerfDataManager::counter_name(name_space(), | |
169 "decreaseForFootprint"); | |
170 _decrease_for_footprint_counter = | |
171 PerfDataManager::create_variable(SUN_GC, cname, | |
172 PerfData::U_Events, (jlong)0, CHECK); | |
173 | |
174 cname = PerfDataManager::counter_name(name_space(), "decideAtFullGc"); | |
175 _decide_at_full_gc_counter = PerfDataManager::create_variable(SUN_GC, cname, | |
176 PerfData::U_None, (jlong)0, CHECK); | |
177 | |
178 cname = PerfDataManager::counter_name(name_space(), "minorPauseYoungSlope"); | |
179 _minor_pause_young_slope_counter = | |
180 PerfDataManager::create_variable(SUN_GC, cname, | |
181 PerfData::U_None, (jlong) 0, CHECK); | |
182 | |
183 cname = PerfDataManager::counter_name(name_space(), "majorCollectionSlope"); | |
184 _major_collection_slope_counter = | |
185 PerfDataManager::create_variable(SUN_GC, cname, | |
186 PerfData::U_None, (jlong) 0, CHECK); | |
187 | |
188 cname = PerfDataManager::counter_name(name_space(), "minorCollectionSlope"); | |
189 _minor_collection_slope_counter = | |
190 PerfDataManager::create_variable(SUN_GC, cname, | |
191 PerfData::U_None, (jlong) 0, CHECK); | |
192 } | |
193 } | |
194 | |
195 void GCAdaptivePolicyCounters::update_counters_from_policy() { | |
196 if (UsePerfData && (size_policy() != NULL)) { | |
197 update_avg_minor_pause_counter(); | |
198 update_avg_minor_interval_counter(); | |
199 #ifdef NOT_PRODUCT | |
200 update_minor_pause_counter(); | |
201 #endif | |
202 update_minor_gc_cost_counter(); | |
203 update_avg_young_live_counter(); | |
204 | |
205 update_survivor_size_counters(); | |
206 update_avg_survived_avg_counters(); | |
207 update_avg_survived_dev_counters(); | |
208 update_avg_survived_padded_avg_counters(); | |
209 | |
210 update_change_old_gen_for_throughput(); | |
211 update_change_young_gen_for_throughput(); | |
212 update_decrease_for_footprint(); | |
213 update_change_young_gen_for_min_pauses(); | |
214 update_change_old_gen_for_maj_pauses(); | |
215 | |
216 update_minor_pause_young_slope_counter(); | |
217 update_minor_collection_slope_counter(); | |
218 update_major_collection_slope_counter(); | |
219 } | |
220 } | |
221 | |
222 void GCAdaptivePolicyCounters::update_counters() { | |
223 if (UsePerfData) { | |
224 update_counters_from_policy(); | |
225 } | |
226 } |