Mercurial > hg > truffle
annotate src/share/vm/gc_implementation/parallelScavenge/psGCAdaptivePolicyCounters.cpp @ 1562:dfe27f03244a
Merge
author | trims |
---|---|
date | Tue, 01 Jun 2010 11:48:33 -0700 |
parents | c18cbe5936b8 |
children | f95d63e2154a |
rev | line source |
---|---|
0 | 1 /* |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1387
diff
changeset
|
2 * Copyright (c) 2003, 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:
1387
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1387
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:
1387
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
25 # include "incls/_precompiled.incl" | |
26 # include "incls/_psGCAdaptivePolicyCounters.cpp.incl" | |
27 | |
28 | |
29 | |
30 PSGCAdaptivePolicyCounters::PSGCAdaptivePolicyCounters(const char* name_arg, | |
31 int collectors, | |
32 int generations, | |
33 PSAdaptiveSizePolicy* size_policy_arg) | |
34 : GCAdaptivePolicyCounters(name_arg, | |
35 collectors, | |
36 generations, | |
37 size_policy_arg) { | |
38 if (UsePerfData) { | |
39 EXCEPTION_MARK; | |
40 ResourceMark rm; | |
41 | |
42 const char* cname; | |
43 | |
44 cname = PerfDataManager::counter_name(name_space(), "oldPromoSize"); | |
45 _old_promo_size = PerfDataManager::create_variable(SUN_GC, cname, | |
46 PerfData::U_Bytes, ps_size_policy()->calculated_promo_size_in_bytes(), CHECK); | |
47 | |
48 cname = PerfDataManager::counter_name(name_space(), "oldEdenSize"); | |
49 _old_eden_size = PerfDataManager::create_variable(SUN_GC, cname, | |
50 PerfData::U_Bytes, ps_size_policy()->calculated_eden_size_in_bytes(), CHECK); | |
51 | |
52 cname = PerfDataManager::counter_name(name_space(), "oldCapacity"); | |
53 _old_capacity = PerfDataManager::create_variable(SUN_GC, cname, | |
1064 | 54 PerfData::U_Bytes, (jlong) InitialHeapSize, CHECK); |
0 | 55 |
56 cname = PerfDataManager::counter_name(name_space(), "boundaryMoved"); | |
57 _boundary_moved = PerfDataManager::create_variable(SUN_GC, cname, | |
58 PerfData::U_Bytes, (jlong) 0, CHECK); | |
59 | |
60 cname = PerfDataManager::counter_name(name_space(), "avgPromotedAvg"); | |
61 _avg_promoted_avg_counter = | |
62 PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Bytes, | |
63 ps_size_policy()->calculated_promo_size_in_bytes(), CHECK); | |
64 | |
65 cname = PerfDataManager::counter_name(name_space(), "avgPromotedDev"); | |
66 _avg_promoted_dev_counter = | |
67 PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Bytes, | |
68 (jlong) 0 , CHECK); | |
69 | |
70 cname = PerfDataManager::counter_name(name_space(), "avgPromotedPaddedAvg"); | |
71 _avg_promoted_padded_avg_counter = | |
72 PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Bytes, | |
73 ps_size_policy()->calculated_promo_size_in_bytes(), CHECK); | |
74 | |
75 cname = PerfDataManager::counter_name(name_space(), | |
76 "avgPretenuredPaddedAvg"); | |
77 _avg_pretenured_padded_avg = | |
78 PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Bytes, | |
79 (jlong) 0, CHECK); | |
80 | |
81 | |
82 cname = PerfDataManager::counter_name(name_space(), | |
83 "changeYoungGenForMajPauses"); | |
84 _change_young_gen_for_maj_pauses_counter = | |
85 PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Events, | |
86 (jlong)0, CHECK); | |
87 | |
88 cname = PerfDataManager::counter_name(name_space(), | |
89 "changeOldGenForMinPauses"); | |
90 _change_old_gen_for_min_pauses = | |
91 PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Events, | |
92 (jlong)0, CHECK); | |
93 | |
94 | |
95 cname = PerfDataManager::counter_name(name_space(), "avgMajorPauseTime"); | |
96 _avg_major_pause = PerfDataManager::create_variable(SUN_GC, cname, | |
97 PerfData::U_Ticks, (jlong) ps_size_policy()->_avg_major_pause->average(), CHECK); | |
98 | |
99 cname = PerfDataManager::counter_name(name_space(), "avgMajorIntervalTime"); | |
100 _avg_major_interval = PerfDataManager::create_variable(SUN_GC, cname, | |
101 PerfData::U_Ticks, (jlong) ps_size_policy()->_avg_major_interval->average(), CHECK); | |
102 | |
103 cname = PerfDataManager::counter_name(name_space(), "majorGcCost"); | |
104 _major_gc_cost_counter = PerfDataManager::create_variable(SUN_GC, cname, | |
105 PerfData::U_Ticks, (jlong) ps_size_policy()->major_gc_cost(), CHECK); | |
106 | |
107 cname = PerfDataManager::counter_name(name_space(), "liveSpace"); | |
108 _live_space = PerfDataManager::create_variable(SUN_GC, cname, | |
109 PerfData::U_Bytes, ps_size_policy()->live_space(), CHECK); | |
110 | |
111 cname = PerfDataManager::counter_name(name_space(), "freeSpace"); | |
112 _free_space = PerfDataManager::create_variable(SUN_GC, cname, | |
113 PerfData::U_Bytes, ps_size_policy()->free_space(), CHECK); | |
114 | |
115 cname = PerfDataManager::counter_name(name_space(), "avgBaseFootprint"); | |
116 _avg_base_footprint = PerfDataManager::create_variable(SUN_GC, cname, | |
117 PerfData::U_Bytes, (jlong) ps_size_policy()->avg_base_footprint()->average(), CHECK); | |
118 | |
119 cname = PerfDataManager::counter_name(name_space(), "gcTimeLimitExceeded"); | |
1387
0bfd3fb24150
6858496: Clear all SoftReferences before an out-of-memory due to GC overhead limit.
jmasa
parents:
1064
diff
changeset
|
120 _gc_overhead_limit_exceeded_counter = |
0bfd3fb24150
6858496: Clear all SoftReferences before an out-of-memory due to GC overhead limit.
jmasa
parents:
1064
diff
changeset
|
121 PerfDataManager::create_variable(SUN_GC, cname, |
0bfd3fb24150
6858496: Clear all SoftReferences before an out-of-memory due to GC overhead limit.
jmasa
parents:
1064
diff
changeset
|
122 PerfData::U_Events, ps_size_policy()->gc_overhead_limit_exceeded(), CHECK); |
0 | 123 |
124 cname = PerfDataManager::counter_name(name_space(), "liveAtLastFullGc"); | |
1387
0bfd3fb24150
6858496: Clear all SoftReferences before an out-of-memory due to GC overhead limit.
jmasa
parents:
1064
diff
changeset
|
125 _live_at_last_full_gc_counter = |
0bfd3fb24150
6858496: Clear all SoftReferences before an out-of-memory due to GC overhead limit.
jmasa
parents:
1064
diff
changeset
|
126 PerfDataManager::create_variable(SUN_GC, cname, |
0 | 127 PerfData::U_Bytes, ps_size_policy()->live_at_last_full_gc(), CHECK); |
128 | |
129 cname = PerfDataManager::counter_name(name_space(), "majorPauseOldSlope"); | |
130 _major_pause_old_slope = PerfDataManager::create_variable(SUN_GC, cname, | |
131 PerfData::U_None, (jlong) 0, CHECK); | |
132 | |
133 cname = PerfDataManager::counter_name(name_space(), "minorPauseOldSlope"); | |
134 _minor_pause_old_slope = PerfDataManager::create_variable(SUN_GC, cname, | |
135 PerfData::U_None, (jlong) 0, CHECK); | |
136 | |
137 cname = PerfDataManager::counter_name(name_space(), "majorPauseYoungSlope"); | |
138 _major_pause_young_slope = PerfDataManager::create_variable(SUN_GC, cname, | |
139 PerfData::U_None, (jlong) 0, CHECK); | |
140 | |
141 cname = PerfDataManager::counter_name(name_space(), "scavengeSkipped"); | |
142 _scavenge_skipped = PerfDataManager::create_variable(SUN_GC, cname, | |
143 PerfData::U_Bytes, (jlong) 0, CHECK); | |
144 | |
145 cname = PerfDataManager::counter_name(name_space(), "fullFollowsScavenge"); | |
146 _full_follows_scavenge = PerfDataManager::create_variable(SUN_GC, cname, | |
147 PerfData::U_Bytes, (jlong) 0, CHECK); | |
148 | |
149 _counter_time_stamp.update(); | |
150 } | |
151 | |
152 assert(size_policy()->is_gc_ps_adaptive_size_policy(), | |
153 "Wrong type of size policy"); | |
154 } | |
155 | |
156 void PSGCAdaptivePolicyCounters::update_counters_from_policy() { | |
157 if (UsePerfData) { | |
158 GCAdaptivePolicyCounters::update_counters_from_policy(); | |
159 update_eden_size(); | |
160 update_promo_size(); | |
161 update_avg_old_live(); | |
162 update_survivor_size_counters(); | |
163 update_avg_promoted_avg(); | |
164 update_avg_promoted_dev(); | |
165 update_avg_promoted_padded_avg(); | |
166 update_avg_pretenured_padded_avg(); | |
167 | |
168 update_avg_major_pause(); | |
169 update_avg_major_interval(); | |
170 update_minor_gc_cost_counter(); | |
171 update_major_gc_cost_counter(); | |
172 update_mutator_cost_counter(); | |
173 update_decrement_tenuring_threshold_for_gc_cost(); | |
174 update_increment_tenuring_threshold_for_gc_cost(); | |
175 update_decrement_tenuring_threshold_for_survivor_limit(); | |
176 update_live_space(); | |
177 update_free_space(); | |
178 update_avg_base_footprint(); | |
179 | |
180 update_change_old_gen_for_maj_pauses(); | |
181 update_change_young_gen_for_maj_pauses(); | |
182 update_change_old_gen_for_min_pauses(); | |
183 | |
184 update_change_old_gen_for_throughput(); | |
185 update_change_young_gen_for_throughput(); | |
186 | |
187 update_decrease_for_footprint(); | |
188 update_decide_at_full_gc_counter(); | |
189 | |
190 update_major_pause_old_slope(); | |
191 update_minor_pause_old_slope(); | |
192 update_major_pause_young_slope(); | |
193 update_minor_collection_slope_counter(); | |
1387
0bfd3fb24150
6858496: Clear all SoftReferences before an out-of-memory due to GC overhead limit.
jmasa
parents:
1064
diff
changeset
|
194 update_gc_overhead_limit_exceeded_counter(); |
0bfd3fb24150
6858496: Clear all SoftReferences before an out-of-memory due to GC overhead limit.
jmasa
parents:
1064
diff
changeset
|
195 update_live_at_last_full_gc_counter(); |
0 | 196 } |
197 } | |
198 | |
199 void PSGCAdaptivePolicyCounters::update_counters() { | |
200 if (UsePerfData) { | |
201 update_counters_from_policy(); | |
202 } | |
203 } |