1.1 --- a/src/share/vm/gc_implementation/g1/g1MonitoringSupport.cpp Thu Feb 23 14:58:35 2012 +0100 1.2 +++ b/src/share/vm/gc_implementation/g1/g1MonitoringSupport.cpp Fri Mar 02 10:36:16 2012 -0800 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 2011, 2012 Oracle and/or its affiliates. All rights reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -44,7 +44,9 @@ 1.11 G1MonitoringSupport::pad_capacity(0, 3) /* min_capacity */, 1.12 G1MonitoringSupport::pad_capacity(g1mm->young_gen_max(), 3), 1.13 G1MonitoringSupport::pad_capacity(0, 3) /* curr_capacity */) { 1.14 - update_all(); 1.15 + if (UsePerfData) { 1.16 + update_all(); 1.17 + } 1.18 } 1.19 1.20 G1OldGenerationCounters::G1OldGenerationCounters(G1MonitoringSupport* g1mm, 1.21 @@ -53,7 +55,9 @@ 1.22 G1MonitoringSupport::pad_capacity(0) /* min_capacity */, 1.23 G1MonitoringSupport::pad_capacity(g1mm->old_gen_max()), 1.24 G1MonitoringSupport::pad_capacity(0) /* curr_capacity */) { 1.25 - update_all(); 1.26 + if (UsePerfData) { 1.27 + update_all(); 1.28 + } 1.29 } 1.30 1.31 void G1YoungGenerationCounters::update_all() { 1.32 @@ -149,10 +153,6 @@ 1.33 pad_capacity(0) /* max_capacity */, 1.34 pad_capacity(0) /* init_capacity */, 1.35 _young_collection_counters); 1.36 - // Given that this survivor space is not used, we update it here 1.37 - // once to reflect that its used space is 0 so that we don't have to 1.38 - // worry about updating it again later. 1.39 - _from_counters->update_used(0); 1.40 1.41 // name "generation.0.space.2" 1.42 // See _old_space_counters for additional counters 1.43 @@ -160,6 +160,13 @@ 1.44 pad_capacity(overall_reserved()) /* max_capacity */, 1.45 pad_capacity(survivor_space_committed()) /* init_capacity */, 1.46 _young_collection_counters); 1.47 + 1.48 + if (UsePerfData) { 1.49 + // Given that this survivor space is not used, we update it here 1.50 + // once to reflect that its used space is 0 so that we don't have to 1.51 + // worry about updating it again later. 1.52 + _from_counters->update_used(0); 1.53 + } 1.54 } 1.55 1.56 void G1MonitoringSupport::recalculate_sizes() {