1 /*
2 * Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved.
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 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 // CMSGCAdaptivePolicyCounters is a holder class for performance counters
26 // that track the data and decisions for the ergonomics policy for the
27 // concurrent mark sweep collector
28
29 class CMSGCAdaptivePolicyCounters : public GCAdaptivePolicyCounters {
30 friend class VMStructs;
31
32 private:
33
34 // Capacity of tenured generation recorded at the end of
35 // any collection.
36 PerfVariable* _cms_capacity_counter; // Make this common with PS _old_capacity
37
38 // Average stop-the-world pause time for both initial and
39 // remark pauses sampled at the end of the checkpointRootsFinalWork.
40 PerfVariable* _avg_cms_STW_time_counter;
41 // Average stop-the-world (STW) GC cost for the STW pause time
42 // _avg_cms_STW_time_counter.
43 PerfVariable* _avg_cms_STW_gc_cost_counter;
44
281 cms_size_policy()->change_young_gen_for_maj_pauses());
282 }
283
284 public:
285 CMSGCAdaptivePolicyCounters(const char* name, int collectors, int generations,
286 AdaptiveSizePolicy* size_policy);
287
288 // update counters
289 void update_counters();
290 void update_counters(CMSGCStats* gc_stats);
291 void update_counters_from_policy();
292
293 inline void update_cms_capacity_counter(size_t size_in_bytes) {
294 _cms_capacity_counter->set_value(size_in_bytes);
295 }
296
297 virtual GCPolicyCounters::Name kind() const {
298 return GCPolicyCounters::CMSGCAdaptivePolicyCountersKind;
299 }
300 };
|
1 /*
2 * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
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 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSGCADAPTIVEPOLICYCOUNTERS_HPP
26 #define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSGCADAPTIVEPOLICYCOUNTERS_HPP
27
28 #include "gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.hpp"
29 #include "gc_implementation/shared/gcAdaptivePolicyCounters.hpp"
30 #include "gc_implementation/shared/gcStats.hpp"
31 #include "runtime/perfData.hpp"
32
33 // CMSGCAdaptivePolicyCounters is a holder class for performance counters
34 // that track the data and decisions for the ergonomics policy for the
35 // concurrent mark sweep collector
36
37 class CMSGCAdaptivePolicyCounters : public GCAdaptivePolicyCounters {
38 friend class VMStructs;
39
40 private:
41
42 // Capacity of tenured generation recorded at the end of
43 // any collection.
44 PerfVariable* _cms_capacity_counter; // Make this common with PS _old_capacity
45
46 // Average stop-the-world pause time for both initial and
47 // remark pauses sampled at the end of the checkpointRootsFinalWork.
48 PerfVariable* _avg_cms_STW_time_counter;
49 // Average stop-the-world (STW) GC cost for the STW pause time
50 // _avg_cms_STW_time_counter.
51 PerfVariable* _avg_cms_STW_gc_cost_counter;
52
289 cms_size_policy()->change_young_gen_for_maj_pauses());
290 }
291
292 public:
293 CMSGCAdaptivePolicyCounters(const char* name, int collectors, int generations,
294 AdaptiveSizePolicy* size_policy);
295
296 // update counters
297 void update_counters();
298 void update_counters(CMSGCStats* gc_stats);
299 void update_counters_from_policy();
300
301 inline void update_cms_capacity_counter(size_t size_in_bytes) {
302 _cms_capacity_counter->set_value(size_in_bytes);
303 }
304
305 virtual GCPolicyCounters::Name kind() const {
306 return GCPolicyCounters::CMSGCAdaptivePolicyCountersKind;
307 }
308 };
309
310 #endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSGCADAPTIVEPOLICYCOUNTERS_HPP
|