Mercurial > hg > truffle
comparison src/share/vm/gc_implementation/g1/g1MonitoringSupport.cpp @ 5916:b5290bf0a9e4
7147806: G1: Crash in vm bootstrap when running with -XX:+UseG1GC -XX:-UsePerfData
Summary: Update generation and collector counters only if UsePerfData is enabled.
Reviewed-by: iveresov, tonyp
author | johnc |
---|---|
date | Fri, 02 Mar 2012 10:36:16 -0800 |
parents | 8229bd737950 |
children | 720b6a76dd9d |
comparison
equal
deleted
inserted
replaced
5915:2d503de963b3 | 5916:b5290bf0a9e4 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2011, 2012 Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 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 | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
42 const char* name) | 42 const char* name) |
43 : G1GenerationCounters(g1mm, name, 0 /* ordinal */, 3 /* spaces */, | 43 : G1GenerationCounters(g1mm, name, 0 /* ordinal */, 3 /* spaces */, |
44 G1MonitoringSupport::pad_capacity(0, 3) /* min_capacity */, | 44 G1MonitoringSupport::pad_capacity(0, 3) /* min_capacity */, |
45 G1MonitoringSupport::pad_capacity(g1mm->young_gen_max(), 3), | 45 G1MonitoringSupport::pad_capacity(g1mm->young_gen_max(), 3), |
46 G1MonitoringSupport::pad_capacity(0, 3) /* curr_capacity */) { | 46 G1MonitoringSupport::pad_capacity(0, 3) /* curr_capacity */) { |
47 update_all(); | 47 if (UsePerfData) { |
48 update_all(); | |
49 } | |
48 } | 50 } |
49 | 51 |
50 G1OldGenerationCounters::G1OldGenerationCounters(G1MonitoringSupport* g1mm, | 52 G1OldGenerationCounters::G1OldGenerationCounters(G1MonitoringSupport* g1mm, |
51 const char* name) | 53 const char* name) |
52 : G1GenerationCounters(g1mm, name, 1 /* ordinal */, 1 /* spaces */, | 54 : G1GenerationCounters(g1mm, name, 1 /* ordinal */, 1 /* spaces */, |
53 G1MonitoringSupport::pad_capacity(0) /* min_capacity */, | 55 G1MonitoringSupport::pad_capacity(0) /* min_capacity */, |
54 G1MonitoringSupport::pad_capacity(g1mm->old_gen_max()), | 56 G1MonitoringSupport::pad_capacity(g1mm->old_gen_max()), |
55 G1MonitoringSupport::pad_capacity(0) /* curr_capacity */) { | 57 G1MonitoringSupport::pad_capacity(0) /* curr_capacity */) { |
56 update_all(); | 58 if (UsePerfData) { |
59 update_all(); | |
60 } | |
57 } | 61 } |
58 | 62 |
59 void G1YoungGenerationCounters::update_all() { | 63 void G1YoungGenerationCounters::update_all() { |
60 size_t committed = | 64 size_t committed = |
61 G1MonitoringSupport::pad_capacity(_g1mm->young_gen_committed(), 3); | 65 G1MonitoringSupport::pad_capacity(_g1mm->young_gen_committed(), 3); |
147 // Set the arguments to indicate that this survivor space is not used. | 151 // Set the arguments to indicate that this survivor space is not used. |
148 _from_counters = new HSpaceCounters("s0", 1 /* ordinal */, | 152 _from_counters = new HSpaceCounters("s0", 1 /* ordinal */, |
149 pad_capacity(0) /* max_capacity */, | 153 pad_capacity(0) /* max_capacity */, |
150 pad_capacity(0) /* init_capacity */, | 154 pad_capacity(0) /* init_capacity */, |
151 _young_collection_counters); | 155 _young_collection_counters); |
152 // Given that this survivor space is not used, we update it here | |
153 // once to reflect that its used space is 0 so that we don't have to | |
154 // worry about updating it again later. | |
155 _from_counters->update_used(0); | |
156 | 156 |
157 // name "generation.0.space.2" | 157 // name "generation.0.space.2" |
158 // See _old_space_counters for additional counters | 158 // See _old_space_counters for additional counters |
159 _to_counters = new HSpaceCounters("s1", 2 /* ordinal */, | 159 _to_counters = new HSpaceCounters("s1", 2 /* ordinal */, |
160 pad_capacity(overall_reserved()) /* max_capacity */, | 160 pad_capacity(overall_reserved()) /* max_capacity */, |
161 pad_capacity(survivor_space_committed()) /* init_capacity */, | 161 pad_capacity(survivor_space_committed()) /* init_capacity */, |
162 _young_collection_counters); | 162 _young_collection_counters); |
163 | |
164 if (UsePerfData) { | |
165 // Given that this survivor space is not used, we update it here | |
166 // once to reflect that its used space is 0 so that we don't have to | |
167 // worry about updating it again later. | |
168 _from_counters->update_used(0); | |
169 } | |
163 } | 170 } |
164 | 171 |
165 void G1MonitoringSupport::recalculate_sizes() { | 172 void G1MonitoringSupport::recalculate_sizes() { |
166 G1CollectedHeap* g1 = g1h(); | 173 G1CollectedHeap* g1 = g1h(); |
167 | 174 |