annotate src/share/vm/gc_implementation/parallelScavenge/psGCAdaptivePolicyCounters.cpp @ 1972:f95d63e2154a

6989984: Use standard include model for Hospot Summary: Replaced MakeDeps and the includeDB files with more standardized solutions. Reviewed-by: coleenp, kvn, kamg
author stefank
date Tue, 23 Nov 2010 13:22:55 -0800
parents c18cbe5936b8
children
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: 1387
diff changeset
2 * Copyright (c) 2003, 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: 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
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 #include "precompiled.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
26 #include "gc_implementation/parallelScavenge/psGCAdaptivePolicyCounters.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
27 #include "memory/resourceArea.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
28 #include "runtime/arguments.hpp"
0
a61af66fc99e Initial load
duke
parents:
diff changeset
29
a61af66fc99e Initial load
duke
parents:
diff changeset
30
a61af66fc99e Initial load
duke
parents:
diff changeset
31
a61af66fc99e Initial load
duke
parents:
diff changeset
32 PSGCAdaptivePolicyCounters::PSGCAdaptivePolicyCounters(const char* name_arg,
a61af66fc99e Initial load
duke
parents:
diff changeset
33 int collectors,
a61af66fc99e Initial load
duke
parents:
diff changeset
34 int generations,
a61af66fc99e Initial load
duke
parents:
diff changeset
35 PSAdaptiveSizePolicy* size_policy_arg)
a61af66fc99e Initial load
duke
parents:
diff changeset
36 : GCAdaptivePolicyCounters(name_arg,
a61af66fc99e Initial load
duke
parents:
diff changeset
37 collectors,
a61af66fc99e Initial load
duke
parents:
diff changeset
38 generations,
a61af66fc99e Initial load
duke
parents:
diff changeset
39 size_policy_arg) {
a61af66fc99e Initial load
duke
parents:
diff changeset
40 if (UsePerfData) {
a61af66fc99e Initial load
duke
parents:
diff changeset
41 EXCEPTION_MARK;
a61af66fc99e Initial load
duke
parents:
diff changeset
42 ResourceMark rm;
a61af66fc99e Initial load
duke
parents:
diff changeset
43
a61af66fc99e Initial load
duke
parents:
diff changeset
44 const char* cname;
a61af66fc99e Initial load
duke
parents:
diff changeset
45
a61af66fc99e Initial load
duke
parents:
diff changeset
46 cname = PerfDataManager::counter_name(name_space(), "oldPromoSize");
a61af66fc99e Initial load
duke
parents:
diff changeset
47 _old_promo_size = PerfDataManager::create_variable(SUN_GC, cname,
a61af66fc99e Initial load
duke
parents:
diff changeset
48 PerfData::U_Bytes, ps_size_policy()->calculated_promo_size_in_bytes(), CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
49
a61af66fc99e Initial load
duke
parents:
diff changeset
50 cname = PerfDataManager::counter_name(name_space(), "oldEdenSize");
a61af66fc99e Initial load
duke
parents:
diff changeset
51 _old_eden_size = PerfDataManager::create_variable(SUN_GC, cname,
a61af66fc99e Initial load
duke
parents:
diff changeset
52 PerfData::U_Bytes, ps_size_policy()->calculated_eden_size_in_bytes(), CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
53
a61af66fc99e Initial load
duke
parents:
diff changeset
54 cname = PerfDataManager::counter_name(name_space(), "oldCapacity");
a61af66fc99e Initial load
duke
parents:
diff changeset
55 _old_capacity = PerfDataManager::create_variable(SUN_GC, cname,
1064
473cce303f13 6887571: Increase default heap config sizes
phh
parents: 0
diff changeset
56 PerfData::U_Bytes, (jlong) InitialHeapSize, CHECK);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
57
a61af66fc99e Initial load
duke
parents:
diff changeset
58 cname = PerfDataManager::counter_name(name_space(), "boundaryMoved");
a61af66fc99e Initial load
duke
parents:
diff changeset
59 _boundary_moved = PerfDataManager::create_variable(SUN_GC, cname,
a61af66fc99e Initial load
duke
parents:
diff changeset
60 PerfData::U_Bytes, (jlong) 0, CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
61
a61af66fc99e Initial load
duke
parents:
diff changeset
62 cname = PerfDataManager::counter_name(name_space(), "avgPromotedAvg");
a61af66fc99e Initial load
duke
parents:
diff changeset
63 _avg_promoted_avg_counter =
a61af66fc99e Initial load
duke
parents:
diff changeset
64 PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Bytes,
a61af66fc99e Initial load
duke
parents:
diff changeset
65 ps_size_policy()->calculated_promo_size_in_bytes(), CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
66
a61af66fc99e Initial load
duke
parents:
diff changeset
67 cname = PerfDataManager::counter_name(name_space(), "avgPromotedDev");
a61af66fc99e Initial load
duke
parents:
diff changeset
68 _avg_promoted_dev_counter =
a61af66fc99e Initial load
duke
parents:
diff changeset
69 PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Bytes,
a61af66fc99e Initial load
duke
parents:
diff changeset
70 (jlong) 0 , CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
71
a61af66fc99e Initial load
duke
parents:
diff changeset
72 cname = PerfDataManager::counter_name(name_space(), "avgPromotedPaddedAvg");
a61af66fc99e Initial load
duke
parents:
diff changeset
73 _avg_promoted_padded_avg_counter =
a61af66fc99e Initial load
duke
parents:
diff changeset
74 PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Bytes,
a61af66fc99e Initial load
duke
parents:
diff changeset
75 ps_size_policy()->calculated_promo_size_in_bytes(), CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
76
a61af66fc99e Initial load
duke
parents:
diff changeset
77 cname = PerfDataManager::counter_name(name_space(),
a61af66fc99e Initial load
duke
parents:
diff changeset
78 "avgPretenuredPaddedAvg");
a61af66fc99e Initial load
duke
parents:
diff changeset
79 _avg_pretenured_padded_avg =
a61af66fc99e Initial load
duke
parents:
diff changeset
80 PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Bytes,
a61af66fc99e Initial load
duke
parents:
diff changeset
81 (jlong) 0, CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
82
a61af66fc99e Initial load
duke
parents:
diff changeset
83
a61af66fc99e Initial load
duke
parents:
diff changeset
84 cname = PerfDataManager::counter_name(name_space(),
a61af66fc99e Initial load
duke
parents:
diff changeset
85 "changeYoungGenForMajPauses");
a61af66fc99e Initial load
duke
parents:
diff changeset
86 _change_young_gen_for_maj_pauses_counter =
a61af66fc99e Initial load
duke
parents:
diff changeset
87 PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Events,
a61af66fc99e Initial load
duke
parents:
diff changeset
88 (jlong)0, CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
89
a61af66fc99e Initial load
duke
parents:
diff changeset
90 cname = PerfDataManager::counter_name(name_space(),
a61af66fc99e Initial load
duke
parents:
diff changeset
91 "changeOldGenForMinPauses");
a61af66fc99e Initial load
duke
parents:
diff changeset
92 _change_old_gen_for_min_pauses =
a61af66fc99e Initial load
duke
parents:
diff changeset
93 PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Events,
a61af66fc99e Initial load
duke
parents:
diff changeset
94 (jlong)0, CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
95
a61af66fc99e Initial load
duke
parents:
diff changeset
96
a61af66fc99e Initial load
duke
parents:
diff changeset
97 cname = PerfDataManager::counter_name(name_space(), "avgMajorPauseTime");
a61af66fc99e Initial load
duke
parents:
diff changeset
98 _avg_major_pause = PerfDataManager::create_variable(SUN_GC, cname,
a61af66fc99e Initial load
duke
parents:
diff changeset
99 PerfData::U_Ticks, (jlong) ps_size_policy()->_avg_major_pause->average(), CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
100
a61af66fc99e Initial load
duke
parents:
diff changeset
101 cname = PerfDataManager::counter_name(name_space(), "avgMajorIntervalTime");
a61af66fc99e Initial load
duke
parents:
diff changeset
102 _avg_major_interval = PerfDataManager::create_variable(SUN_GC, cname,
a61af66fc99e Initial load
duke
parents:
diff changeset
103 PerfData::U_Ticks, (jlong) ps_size_policy()->_avg_major_interval->average(), CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
104
a61af66fc99e Initial load
duke
parents:
diff changeset
105 cname = PerfDataManager::counter_name(name_space(), "majorGcCost");
a61af66fc99e Initial load
duke
parents:
diff changeset
106 _major_gc_cost_counter = PerfDataManager::create_variable(SUN_GC, cname,
a61af66fc99e Initial load
duke
parents:
diff changeset
107 PerfData::U_Ticks, (jlong) ps_size_policy()->major_gc_cost(), CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
108
a61af66fc99e Initial load
duke
parents:
diff changeset
109 cname = PerfDataManager::counter_name(name_space(), "liveSpace");
a61af66fc99e Initial load
duke
parents:
diff changeset
110 _live_space = PerfDataManager::create_variable(SUN_GC, cname,
a61af66fc99e Initial load
duke
parents:
diff changeset
111 PerfData::U_Bytes, ps_size_policy()->live_space(), CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
112
a61af66fc99e Initial load
duke
parents:
diff changeset
113 cname = PerfDataManager::counter_name(name_space(), "freeSpace");
a61af66fc99e Initial load
duke
parents:
diff changeset
114 _free_space = PerfDataManager::create_variable(SUN_GC, cname,
a61af66fc99e Initial load
duke
parents:
diff changeset
115 PerfData::U_Bytes, ps_size_policy()->free_space(), CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
116
a61af66fc99e Initial load
duke
parents:
diff changeset
117 cname = PerfDataManager::counter_name(name_space(), "avgBaseFootprint");
a61af66fc99e Initial load
duke
parents:
diff changeset
118 _avg_base_footprint = PerfDataManager::create_variable(SUN_GC, cname,
a61af66fc99e Initial load
duke
parents:
diff changeset
119 PerfData::U_Bytes, (jlong) ps_size_policy()->avg_base_footprint()->average(), CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
120
a61af66fc99e Initial load
duke
parents:
diff changeset
121 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
122 _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
123 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
124 PerfData::U_Events, ps_size_policy()->gc_overhead_limit_exceeded(), CHECK);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
125
a61af66fc99e Initial load
duke
parents:
diff changeset
126 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
127 _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
128 PerfDataManager::create_variable(SUN_GC, cname,
0
a61af66fc99e Initial load
duke
parents:
diff changeset
129 PerfData::U_Bytes, ps_size_policy()->live_at_last_full_gc(), CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
130
a61af66fc99e Initial load
duke
parents:
diff changeset
131 cname = PerfDataManager::counter_name(name_space(), "majorPauseOldSlope");
a61af66fc99e Initial load
duke
parents:
diff changeset
132 _major_pause_old_slope = PerfDataManager::create_variable(SUN_GC, cname,
a61af66fc99e Initial load
duke
parents:
diff changeset
133 PerfData::U_None, (jlong) 0, CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
134
a61af66fc99e Initial load
duke
parents:
diff changeset
135 cname = PerfDataManager::counter_name(name_space(), "minorPauseOldSlope");
a61af66fc99e Initial load
duke
parents:
diff changeset
136 _minor_pause_old_slope = PerfDataManager::create_variable(SUN_GC, cname,
a61af66fc99e Initial load
duke
parents:
diff changeset
137 PerfData::U_None, (jlong) 0, CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
138
a61af66fc99e Initial load
duke
parents:
diff changeset
139 cname = PerfDataManager::counter_name(name_space(), "majorPauseYoungSlope");
a61af66fc99e Initial load
duke
parents:
diff changeset
140 _major_pause_young_slope = PerfDataManager::create_variable(SUN_GC, cname,
a61af66fc99e Initial load
duke
parents:
diff changeset
141 PerfData::U_None, (jlong) 0, CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
142
a61af66fc99e Initial load
duke
parents:
diff changeset
143 cname = PerfDataManager::counter_name(name_space(), "scavengeSkipped");
a61af66fc99e Initial load
duke
parents:
diff changeset
144 _scavenge_skipped = PerfDataManager::create_variable(SUN_GC, cname,
a61af66fc99e Initial load
duke
parents:
diff changeset
145 PerfData::U_Bytes, (jlong) 0, CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
146
a61af66fc99e Initial load
duke
parents:
diff changeset
147 cname = PerfDataManager::counter_name(name_space(), "fullFollowsScavenge");
a61af66fc99e Initial load
duke
parents:
diff changeset
148 _full_follows_scavenge = PerfDataManager::create_variable(SUN_GC, cname,
a61af66fc99e Initial load
duke
parents:
diff changeset
149 PerfData::U_Bytes, (jlong) 0, CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
150
a61af66fc99e Initial load
duke
parents:
diff changeset
151 _counter_time_stamp.update();
a61af66fc99e Initial load
duke
parents:
diff changeset
152 }
a61af66fc99e Initial load
duke
parents:
diff changeset
153
a61af66fc99e Initial load
duke
parents:
diff changeset
154 assert(size_policy()->is_gc_ps_adaptive_size_policy(),
a61af66fc99e Initial load
duke
parents:
diff changeset
155 "Wrong type of size policy");
a61af66fc99e Initial load
duke
parents:
diff changeset
156 }
a61af66fc99e Initial load
duke
parents:
diff changeset
157
a61af66fc99e Initial load
duke
parents:
diff changeset
158 void PSGCAdaptivePolicyCounters::update_counters_from_policy() {
a61af66fc99e Initial load
duke
parents:
diff changeset
159 if (UsePerfData) {
a61af66fc99e Initial load
duke
parents:
diff changeset
160 GCAdaptivePolicyCounters::update_counters_from_policy();
a61af66fc99e Initial load
duke
parents:
diff changeset
161 update_eden_size();
a61af66fc99e Initial load
duke
parents:
diff changeset
162 update_promo_size();
a61af66fc99e Initial load
duke
parents:
diff changeset
163 update_avg_old_live();
a61af66fc99e Initial load
duke
parents:
diff changeset
164 update_survivor_size_counters();
a61af66fc99e Initial load
duke
parents:
diff changeset
165 update_avg_promoted_avg();
a61af66fc99e Initial load
duke
parents:
diff changeset
166 update_avg_promoted_dev();
a61af66fc99e Initial load
duke
parents:
diff changeset
167 update_avg_promoted_padded_avg();
a61af66fc99e Initial load
duke
parents:
diff changeset
168 update_avg_pretenured_padded_avg();
a61af66fc99e Initial load
duke
parents:
diff changeset
169
a61af66fc99e Initial load
duke
parents:
diff changeset
170 update_avg_major_pause();
a61af66fc99e Initial load
duke
parents:
diff changeset
171 update_avg_major_interval();
a61af66fc99e Initial load
duke
parents:
diff changeset
172 update_minor_gc_cost_counter();
a61af66fc99e Initial load
duke
parents:
diff changeset
173 update_major_gc_cost_counter();
a61af66fc99e Initial load
duke
parents:
diff changeset
174 update_mutator_cost_counter();
a61af66fc99e Initial load
duke
parents:
diff changeset
175 update_decrement_tenuring_threshold_for_gc_cost();
a61af66fc99e Initial load
duke
parents:
diff changeset
176 update_increment_tenuring_threshold_for_gc_cost();
a61af66fc99e Initial load
duke
parents:
diff changeset
177 update_decrement_tenuring_threshold_for_survivor_limit();
a61af66fc99e Initial load
duke
parents:
diff changeset
178 update_live_space();
a61af66fc99e Initial load
duke
parents:
diff changeset
179 update_free_space();
a61af66fc99e Initial load
duke
parents:
diff changeset
180 update_avg_base_footprint();
a61af66fc99e Initial load
duke
parents:
diff changeset
181
a61af66fc99e Initial load
duke
parents:
diff changeset
182 update_change_old_gen_for_maj_pauses();
a61af66fc99e Initial load
duke
parents:
diff changeset
183 update_change_young_gen_for_maj_pauses();
a61af66fc99e Initial load
duke
parents:
diff changeset
184 update_change_old_gen_for_min_pauses();
a61af66fc99e Initial load
duke
parents:
diff changeset
185
a61af66fc99e Initial load
duke
parents:
diff changeset
186 update_change_old_gen_for_throughput();
a61af66fc99e Initial load
duke
parents:
diff changeset
187 update_change_young_gen_for_throughput();
a61af66fc99e Initial load
duke
parents:
diff changeset
188
a61af66fc99e Initial load
duke
parents:
diff changeset
189 update_decrease_for_footprint();
a61af66fc99e Initial load
duke
parents:
diff changeset
190 update_decide_at_full_gc_counter();
a61af66fc99e Initial load
duke
parents:
diff changeset
191
a61af66fc99e Initial load
duke
parents:
diff changeset
192 update_major_pause_old_slope();
a61af66fc99e Initial load
duke
parents:
diff changeset
193 update_minor_pause_old_slope();
a61af66fc99e Initial load
duke
parents:
diff changeset
194 update_major_pause_young_slope();
a61af66fc99e Initial load
duke
parents:
diff changeset
195 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
196 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
197 update_live_at_last_full_gc_counter();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
198 }
a61af66fc99e Initial load
duke
parents:
diff changeset
199 }
a61af66fc99e Initial load
duke
parents:
diff changeset
200
a61af66fc99e Initial load
duke
parents:
diff changeset
201 void PSGCAdaptivePolicyCounters::update_counters() {
a61af66fc99e Initial load
duke
parents:
diff changeset
202 if (UsePerfData) {
a61af66fc99e Initial load
duke
parents:
diff changeset
203 update_counters_from_policy();
a61af66fc99e Initial load
duke
parents:
diff changeset
204 }
a61af66fc99e Initial load
duke
parents:
diff changeset
205 }