annotate src/share/vm/gc_implementation/parallelScavenge/psGCAdaptivePolicyCounters.hpp @ 2149:7e37af9d69ef

7011379: G1: overly long concurrent marking cycles Summary: This changeset introduces filtering of SATB buffers at the point when they are about to be enqueued. If this filtering clears enough entries on each buffer, the buffer can then be re-used and not enqueued. This cuts down the number of SATB buffers that need to be processed by the concurrent marking threads. Reviewed-by: johnc, ysr
author tonyp
date Wed, 19 Jan 2011 09:35:17 -0500
parents f95d63e2154a
children 14d3f71f831d
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 #ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSGCADAPTIVEPOLICYCOUNTERS_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
26 #define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSGCADAPTIVEPOLICYCOUNTERS_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
27
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
28 #include "gc_implementation/parallelScavenge/psAdaptiveSizePolicy.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
29 #include "gc_implementation/shared/gcAdaptivePolicyCounters.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
30 #include "gc_implementation/shared/gcPolicyCounters.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
31
0
a61af66fc99e Initial load
duke
parents:
diff changeset
32 // PSGCAdaptivePolicyCounters is a holder class for performance counters
a61af66fc99e Initial load
duke
parents:
diff changeset
33 // that track the data and decisions for the ergonomics policy for the
a61af66fc99e Initial load
duke
parents:
diff changeset
34 // parallel scavenge collector.
a61af66fc99e Initial load
duke
parents:
diff changeset
35
a61af66fc99e Initial load
duke
parents:
diff changeset
36 class PSGCAdaptivePolicyCounters : public GCAdaptivePolicyCounters {
a61af66fc99e Initial load
duke
parents:
diff changeset
37 friend class VMStructs;
a61af66fc99e Initial load
duke
parents:
diff changeset
38
a61af66fc99e Initial load
duke
parents:
diff changeset
39 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
40 // survivor space vs. tenuring threshold
a61af66fc99e Initial load
duke
parents:
diff changeset
41 PerfVariable* _old_promo_size;
a61af66fc99e Initial load
duke
parents:
diff changeset
42 PerfVariable* _old_eden_size;
a61af66fc99e Initial load
duke
parents:
diff changeset
43 PerfVariable* _avg_promoted_avg_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
44 PerfVariable* _avg_promoted_dev_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
45 PerfVariable* _avg_promoted_padded_avg_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
46 PerfVariable* _avg_pretenured_padded_avg;
a61af66fc99e Initial load
duke
parents:
diff changeset
47
a61af66fc99e Initial load
duke
parents:
diff changeset
48 // young gen vs. old gen sizing
a61af66fc99e Initial load
duke
parents:
diff changeset
49 PerfVariable* _avg_major_pause;
a61af66fc99e Initial load
duke
parents:
diff changeset
50 PerfVariable* _avg_major_interval;
a61af66fc99e Initial load
duke
parents:
diff changeset
51 PerfVariable* _live_space;
a61af66fc99e Initial load
duke
parents:
diff changeset
52 PerfVariable* _free_space;
a61af66fc99e Initial load
duke
parents:
diff changeset
53 PerfVariable* _avg_base_footprint;
1387
0bfd3fb24150 6858496: Clear all SoftReferences before an out-of-memory due to GC overhead limit.
jmasa
parents: 0
diff changeset
54 PerfVariable* _gc_overhead_limit_exceeded_counter;
0bfd3fb24150 6858496: Clear all SoftReferences before an out-of-memory due to GC overhead limit.
jmasa
parents: 0
diff changeset
55 PerfVariable* _live_at_last_full_gc_counter;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
56 PerfVariable* _old_capacity;
a61af66fc99e Initial load
duke
parents:
diff changeset
57 PerfVariable* _boundary_moved;
a61af66fc99e Initial load
duke
parents:
diff changeset
58
a61af66fc99e Initial load
duke
parents:
diff changeset
59 PerfVariable* _change_old_gen_for_min_pauses;
a61af66fc99e Initial load
duke
parents:
diff changeset
60 PerfVariable* _change_young_gen_for_maj_pauses_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
61
a61af66fc99e Initial load
duke
parents:
diff changeset
62 PerfVariable* _major_pause_old_slope;
a61af66fc99e Initial load
duke
parents:
diff changeset
63 PerfVariable* _minor_pause_old_slope;
a61af66fc99e Initial load
duke
parents:
diff changeset
64 PerfVariable* _major_pause_young_slope;
a61af66fc99e Initial load
duke
parents:
diff changeset
65
a61af66fc99e Initial load
duke
parents:
diff changeset
66 PerfVariable* _scavenge_skipped;
a61af66fc99e Initial load
duke
parents:
diff changeset
67 PerfVariable* _full_follows_scavenge;
a61af66fc99e Initial load
duke
parents:
diff changeset
68
a61af66fc99e Initial load
duke
parents:
diff changeset
69 // Use this time stamp if the gc time stamp is not available.
a61af66fc99e Initial load
duke
parents:
diff changeset
70 TimeStamp _counter_time_stamp;
a61af66fc99e Initial load
duke
parents:
diff changeset
71
a61af66fc99e Initial load
duke
parents:
diff changeset
72 protected:
a61af66fc99e Initial load
duke
parents:
diff changeset
73 PSAdaptiveSizePolicy* ps_size_policy() {
a61af66fc99e Initial load
duke
parents:
diff changeset
74 return (PSAdaptiveSizePolicy*)_size_policy;
a61af66fc99e Initial load
duke
parents:
diff changeset
75 }
a61af66fc99e Initial load
duke
parents:
diff changeset
76
a61af66fc99e Initial load
duke
parents:
diff changeset
77 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
78 PSGCAdaptivePolicyCounters(const char* name, int collectors, int generations,
a61af66fc99e Initial load
duke
parents:
diff changeset
79 PSAdaptiveSizePolicy* size_policy);
a61af66fc99e Initial load
duke
parents:
diff changeset
80 inline void update_old_capacity(size_t size_in_bytes) {
a61af66fc99e Initial load
duke
parents:
diff changeset
81 _old_capacity->set_value(size_in_bytes);
a61af66fc99e Initial load
duke
parents:
diff changeset
82 }
a61af66fc99e Initial load
duke
parents:
diff changeset
83 inline void update_old_eden_size(size_t old_size) {
a61af66fc99e Initial load
duke
parents:
diff changeset
84 _old_eden_size->set_value(old_size);
a61af66fc99e Initial load
duke
parents:
diff changeset
85 }
a61af66fc99e Initial load
duke
parents:
diff changeset
86 inline void update_old_promo_size(size_t old_size) {
a61af66fc99e Initial load
duke
parents:
diff changeset
87 _old_promo_size->set_value(old_size);
a61af66fc99e Initial load
duke
parents:
diff changeset
88 }
a61af66fc99e Initial load
duke
parents:
diff changeset
89 inline void update_boundary_moved(int size_in_bytes) {
a61af66fc99e Initial load
duke
parents:
diff changeset
90 _boundary_moved->set_value(size_in_bytes);
a61af66fc99e Initial load
duke
parents:
diff changeset
91 }
a61af66fc99e Initial load
duke
parents:
diff changeset
92 inline void update_avg_promoted_avg() {
a61af66fc99e Initial load
duke
parents:
diff changeset
93 _avg_promoted_avg_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
94 (jlong)(ps_size_policy()->avg_promoted()->average())
a61af66fc99e Initial load
duke
parents:
diff changeset
95 );
a61af66fc99e Initial load
duke
parents:
diff changeset
96 }
a61af66fc99e Initial load
duke
parents:
diff changeset
97 inline void update_avg_promoted_dev() {
a61af66fc99e Initial load
duke
parents:
diff changeset
98 _avg_promoted_dev_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
99 (jlong)(ps_size_policy()->avg_promoted()->deviation())
a61af66fc99e Initial load
duke
parents:
diff changeset
100 );
a61af66fc99e Initial load
duke
parents:
diff changeset
101 }
a61af66fc99e Initial load
duke
parents:
diff changeset
102 inline void update_avg_promoted_padded_avg() {
a61af66fc99e Initial load
duke
parents:
diff changeset
103 _avg_promoted_padded_avg_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
104 (jlong)(ps_size_policy()->avg_promoted()->padded_average())
a61af66fc99e Initial load
duke
parents:
diff changeset
105 );
a61af66fc99e Initial load
duke
parents:
diff changeset
106 }
a61af66fc99e Initial load
duke
parents:
diff changeset
107
a61af66fc99e Initial load
duke
parents:
diff changeset
108 inline void update_avg_pretenured_padded_avg() {
a61af66fc99e Initial load
duke
parents:
diff changeset
109 _avg_pretenured_padded_avg->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
110 (jlong)(ps_size_policy()->_avg_pretenured->padded_average())
a61af66fc99e Initial load
duke
parents:
diff changeset
111 );
a61af66fc99e Initial load
duke
parents:
diff changeset
112 }
a61af66fc99e Initial load
duke
parents:
diff changeset
113 inline void update_change_young_gen_for_maj_pauses() {
a61af66fc99e Initial load
duke
parents:
diff changeset
114 _change_young_gen_for_maj_pauses_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
115 ps_size_policy()->change_young_gen_for_maj_pauses());
a61af66fc99e Initial load
duke
parents:
diff changeset
116 }
a61af66fc99e Initial load
duke
parents:
diff changeset
117 inline void update_change_old_gen_for_min_pauses() {
a61af66fc99e Initial load
duke
parents:
diff changeset
118 _change_old_gen_for_min_pauses->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
119 ps_size_policy()->change_old_gen_for_min_pauses());
a61af66fc99e Initial load
duke
parents:
diff changeset
120 }
a61af66fc99e Initial load
duke
parents:
diff changeset
121
a61af66fc99e Initial load
duke
parents:
diff changeset
122 // compute_generation_free_space() statistics
a61af66fc99e Initial load
duke
parents:
diff changeset
123
a61af66fc99e Initial load
duke
parents:
diff changeset
124 inline void update_avg_major_pause() {
a61af66fc99e Initial load
duke
parents:
diff changeset
125 _avg_major_pause->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
126 (jlong)(ps_size_policy()->_avg_major_pause->average() * 1000.0)
a61af66fc99e Initial load
duke
parents:
diff changeset
127 );
a61af66fc99e Initial load
duke
parents:
diff changeset
128 }
a61af66fc99e Initial load
duke
parents:
diff changeset
129 inline void update_avg_major_interval() {
a61af66fc99e Initial load
duke
parents:
diff changeset
130 _avg_major_interval->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
131 (jlong)(ps_size_policy()->_avg_major_interval->average() * 1000.0)
a61af66fc99e Initial load
duke
parents:
diff changeset
132 );
a61af66fc99e Initial load
duke
parents:
diff changeset
133 }
a61af66fc99e Initial load
duke
parents:
diff changeset
134
a61af66fc99e Initial load
duke
parents:
diff changeset
135 inline void update_major_gc_cost_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
136 _major_gc_cost_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
137 (jlong)(ps_size_policy()->major_gc_cost() * 100.0)
a61af66fc99e Initial load
duke
parents:
diff changeset
138 );
a61af66fc99e Initial load
duke
parents:
diff changeset
139 }
a61af66fc99e Initial load
duke
parents:
diff changeset
140 inline void update_mutator_cost_counter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
141 _mutator_cost_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
142 (jlong)(ps_size_policy()->mutator_cost() * 100.0)
a61af66fc99e Initial load
duke
parents:
diff changeset
143 );
a61af66fc99e Initial load
duke
parents:
diff changeset
144 }
a61af66fc99e Initial load
duke
parents:
diff changeset
145
a61af66fc99e Initial load
duke
parents:
diff changeset
146 inline void update_live_space() {
a61af66fc99e Initial load
duke
parents:
diff changeset
147 _live_space->set_value(ps_size_policy()->live_space());
a61af66fc99e Initial load
duke
parents:
diff changeset
148 }
a61af66fc99e Initial load
duke
parents:
diff changeset
149 inline void update_free_space() {
a61af66fc99e Initial load
duke
parents:
diff changeset
150 _free_space->set_value(ps_size_policy()->free_space());
a61af66fc99e Initial load
duke
parents:
diff changeset
151 }
a61af66fc99e Initial load
duke
parents:
diff changeset
152
a61af66fc99e Initial load
duke
parents:
diff changeset
153 inline void update_avg_base_footprint() {
a61af66fc99e Initial load
duke
parents:
diff changeset
154 _avg_base_footprint->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
155 (jlong)(ps_size_policy()->avg_base_footprint()->average())
a61af66fc99e Initial load
duke
parents:
diff changeset
156 );
a61af66fc99e Initial load
duke
parents:
diff changeset
157 }
a61af66fc99e Initial load
duke
parents:
diff changeset
158 inline void update_avg_old_live() {
a61af66fc99e Initial load
duke
parents:
diff changeset
159 _avg_old_live_counter->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
160 (jlong)(ps_size_policy()->avg_old_live()->average())
a61af66fc99e Initial load
duke
parents:
diff changeset
161 );
a61af66fc99e Initial load
duke
parents:
diff changeset
162 }
a61af66fc99e Initial load
duke
parents:
diff changeset
163 // Scale up all the slopes
a61af66fc99e Initial load
duke
parents:
diff changeset
164 inline void update_major_pause_old_slope() {
a61af66fc99e Initial load
duke
parents:
diff changeset
165 _major_pause_old_slope->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
166 (jlong)(ps_size_policy()->major_pause_old_slope() * 1000)
a61af66fc99e Initial load
duke
parents:
diff changeset
167 );
a61af66fc99e Initial load
duke
parents:
diff changeset
168 }
a61af66fc99e Initial load
duke
parents:
diff changeset
169 inline void update_minor_pause_old_slope() {
a61af66fc99e Initial load
duke
parents:
diff changeset
170 _minor_pause_old_slope->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
171 (jlong)(ps_size_policy()->minor_pause_old_slope() * 1000)
a61af66fc99e Initial load
duke
parents:
diff changeset
172 );
a61af66fc99e Initial load
duke
parents:
diff changeset
173 }
a61af66fc99e Initial load
duke
parents:
diff changeset
174 inline void update_major_pause_young_slope() {
a61af66fc99e Initial load
duke
parents:
diff changeset
175 _major_pause_young_slope->set_value(
a61af66fc99e Initial load
duke
parents:
diff changeset
176 (jlong)(ps_size_policy()->major_pause_young_slope() * 1000)
a61af66fc99e Initial load
duke
parents:
diff changeset
177 );
a61af66fc99e Initial load
duke
parents:
diff changeset
178 }
1387
0bfd3fb24150 6858496: Clear all SoftReferences before an out-of-memory due to GC overhead limit.
jmasa
parents: 0
diff changeset
179 inline void update_gc_overhead_limit_exceeded_counter() {
0bfd3fb24150 6858496: Clear all SoftReferences before an out-of-memory due to GC overhead limit.
jmasa
parents: 0
diff changeset
180 _gc_overhead_limit_exceeded_counter->set_value(
0bfd3fb24150 6858496: Clear all SoftReferences before an out-of-memory due to GC overhead limit.
jmasa
parents: 0
diff changeset
181 (jlong) ps_size_policy()->gc_overhead_limit_exceeded());
0bfd3fb24150 6858496: Clear all SoftReferences before an out-of-memory due to GC overhead limit.
jmasa
parents: 0
diff changeset
182 }
0bfd3fb24150 6858496: Clear all SoftReferences before an out-of-memory due to GC overhead limit.
jmasa
parents: 0
diff changeset
183 inline void update_live_at_last_full_gc_counter() {
0bfd3fb24150 6858496: Clear all SoftReferences before an out-of-memory due to GC overhead limit.
jmasa
parents: 0
diff changeset
184 _live_at_last_full_gc_counter->set_value(
0bfd3fb24150 6858496: Clear all SoftReferences before an out-of-memory due to GC overhead limit.
jmasa
parents: 0
diff changeset
185 (jlong)(ps_size_policy()->live_at_last_full_gc()));
0bfd3fb24150 6858496: Clear all SoftReferences before an out-of-memory due to GC overhead limit.
jmasa
parents: 0
diff changeset
186 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
187
a61af66fc99e Initial load
duke
parents:
diff changeset
188 inline void update_scavenge_skipped(int cause) {
a61af66fc99e Initial load
duke
parents:
diff changeset
189 _scavenge_skipped->set_value(cause);
a61af66fc99e Initial load
duke
parents:
diff changeset
190 }
a61af66fc99e Initial load
duke
parents:
diff changeset
191
a61af66fc99e Initial load
duke
parents:
diff changeset
192 inline void update_full_follows_scavenge(int event) {
a61af66fc99e Initial load
duke
parents:
diff changeset
193 _full_follows_scavenge->set_value(event);
a61af66fc99e Initial load
duke
parents:
diff changeset
194 }
a61af66fc99e Initial load
duke
parents:
diff changeset
195
a61af66fc99e Initial load
duke
parents:
diff changeset
196 // Update all the counters that can be updated from the size policy.
a61af66fc99e Initial load
duke
parents:
diff changeset
197 // This should be called after all policy changes have been made
a61af66fc99e Initial load
duke
parents:
diff changeset
198 // and reflected internall in the size policy.
a61af66fc99e Initial load
duke
parents:
diff changeset
199 void update_counters_from_policy();
a61af66fc99e Initial load
duke
parents:
diff changeset
200
a61af66fc99e Initial load
duke
parents:
diff changeset
201 // Update counters that can be updated from fields internal to the
a61af66fc99e Initial load
duke
parents:
diff changeset
202 // counter or from globals. This is distinguished from counters
a61af66fc99e Initial load
duke
parents:
diff changeset
203 // that are updated via input parameters.
a61af66fc99e Initial load
duke
parents:
diff changeset
204 void update_counters();
a61af66fc99e Initial load
duke
parents:
diff changeset
205
a61af66fc99e Initial load
duke
parents:
diff changeset
206 virtual GCPolicyCounters::Name kind() const {
a61af66fc99e Initial load
duke
parents:
diff changeset
207 return GCPolicyCounters::PSGCAdaptivePolicyCountersKind;
a61af66fc99e Initial load
duke
parents:
diff changeset
208 }
a61af66fc99e Initial load
duke
parents:
diff changeset
209 };
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
210
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
211 #endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSGCADAPTIVEPOLICYCOUNTERS_HPP