hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.hpp
author jmasa
Fri, 16 Aug 2013 06:12:46 -0700
changeset 19548 e81917358076
parent 7397 5b173b4ca846
child 22551 9bf46d16dcc6
permissions -rw-r--r--
8022817: CMS should not shrink if compaction was not done Reviewed-by: ysr, mgerdin
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
     2
 * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
 *
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 2131
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 2131
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 2131
diff changeset
    21
 * questions.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    25
#ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSGCADAPTIVEPOLICYCOUNTERS_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    26
#define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSGCADAPTIVEPOLICYCOUNTERS_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    27
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    28
#include "gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    29
#include "gc_implementation/shared/gcAdaptivePolicyCounters.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    30
#include "gc_implementation/shared/gcStats.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    31
#include "runtime/perfData.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    32
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
// CMSGCAdaptivePolicyCounters is a holder class for performance counters
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
// that track the data and decisions for the ergonomics policy for the
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
// concurrent mark sweep collector
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
class CMSGCAdaptivePolicyCounters : public GCAdaptivePolicyCounters {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
  friend class VMStructs;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
  // Capacity of tenured generation recorded at the end of
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
  // any collection.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
  PerfVariable* _cms_capacity_counter; // Make this common with PS _old_capacity
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
  // Average stop-the-world pause time for both initial and
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
  // remark pauses sampled at the end of the checkpointRootsFinalWork.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
  PerfVariable* _avg_cms_STW_time_counter;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
  // Average stop-the-world (STW) GC cost for the STW pause time
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
  // _avg_cms_STW_time_counter.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
  PerfVariable* _avg_cms_STW_gc_cost_counter;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
#ifdef NOT_PRODUCT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
  // These are useful to see how the most recent values of these
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
  // counters compare to their respective averages but
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
  // do not control behavior.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
  PerfVariable* _initial_pause_counter;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
  PerfVariable* _remark_pause_counter;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
  // Average of the initial marking pause for a concurrent collection.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
  PerfVariable* _avg_initial_pause_counter;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
  // Average of the remark pause for a concurrent collection.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
  PerfVariable* _avg_remark_pause_counter;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
  // Average for the sum of all the concurrent times per collection.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
  PerfVariable* _avg_concurrent_time_counter;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
  // Average for the time between the most recent end of a
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
  // concurrent collection and the beginning of the next
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
  // concurrent collection.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
  PerfVariable* _avg_concurrent_interval_counter;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
  // Average of the concurrent GC costs based on _avg_concurrent_time_counter
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
  // and _avg_concurrent_interval_counter.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
  PerfVariable* _avg_concurrent_gc_cost_counter;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
  // Average of the free space in the tenured generation at the
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
  // end of the sweep of the tenured generation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
  PerfVariable* _avg_cms_free_counter;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
  // Average of the free space in the tenured generation at the
2131
98f9cef66a34 6810672: Comment typos
twisti
parents: 1
diff changeset
    80
  // start of the sweep of the tenured generation.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
  PerfVariable* _avg_cms_free_at_sweep_counter;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
  // Average of the free space in the tenured generation at the
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
  // after any resizing of the tenured generation at the end
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
  // of a collection of the tenured generation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
  PerfVariable* _avg_cms_promo_counter;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
  // Average of  the mark-sweep-compact (MSC) pause time for a collection
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
  // of the tenured generation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
  PerfVariable* _avg_msc_pause_counter;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
  // Average for the time between the most recent end of a
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
  // MSC collection and the beginning of the next
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
  // MSC collection.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
  PerfVariable* _avg_msc_interval_counter;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
  // Average for the GC cost of a MSC collection based on
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
  // _avg_msc_pause_counter and _avg_msc_interval_counter.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
  PerfVariable* _msc_gc_cost_counter;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
  // Average of  the mark-sweep (MS) pause time for a collection
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
  // of the tenured generation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
  PerfVariable* _avg_ms_pause_counter;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
  // Average for the time between the most recent end of a
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
  // MS collection and the beginning of the next
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
  // MS collection.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
  PerfVariable* _avg_ms_interval_counter;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
  // Average for the GC cost of a MS collection based on
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
  // _avg_ms_pause_counter and _avg_ms_interval_counter.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
  PerfVariable* _ms_gc_cost_counter;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
  // Average of the bytes promoted per minor collection.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
  PerfVariable* _promoted_avg_counter;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
  // Average of the deviation of the promoted average
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
  PerfVariable* _promoted_avg_dev_counter;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
  // Padded average of the bytes promoted per minor colleciton
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
  PerfVariable* _promoted_padded_avg_counter;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
  // See description of the _change_young_gen_for_maj_pauses
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
  // variable recently in cmsAdaptiveSizePolicy.hpp.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
  PerfVariable* _change_young_gen_for_maj_pauses_counter;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
  // See descriptions of _remark_pause_old_slope, _initial_pause_old_slope,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
  // etc. variables recently in cmsAdaptiveSizePolicy.hpp.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
  PerfVariable* _remark_pause_old_slope_counter;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
  PerfVariable* _initial_pause_old_slope_counter;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
  PerfVariable* _remark_pause_young_slope_counter;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
  PerfVariable* _initial_pause_young_slope_counter;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
  CMSAdaptiveSizePolicy* cms_size_policy() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
    assert(_size_policy->kind() ==
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
      AdaptiveSizePolicy::_gc_cms_adaptive_size_policy,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
      "Wrong size policy");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
    return (CMSAdaptiveSizePolicy*)_size_policy;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
  inline void update_avg_cms_STW_time_counter() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
    _avg_cms_STW_time_counter->set_value(
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
      (jlong) (cms_size_policy()->avg_cms_STW_time()->average() *
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
      (double) MILLIUNITS));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
  inline void update_avg_cms_STW_gc_cost_counter() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
    _avg_cms_STW_gc_cost_counter->set_value(
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
      (jlong) (cms_size_policy()->avg_cms_STW_gc_cost()->average() * 100.0));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
  inline void update_avg_initial_pause_counter() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
    _avg_initial_pause_counter->set_value(
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
      (jlong) (cms_size_policy()->avg_initial_pause()->average() *
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
      (double) MILLIUNITS));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
#ifdef NOT_PRODUCT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
  inline void update_avg_remark_pause_counter() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
    _avg_remark_pause_counter->set_value(
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
      (jlong) (cms_size_policy()-> avg_remark_pause()->average() *
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
      (double) MILLIUNITS));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
  inline void update_initial_pause_counter() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
    _initial_pause_counter->set_value(
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
      (jlong) (cms_size_policy()->avg_initial_pause()->average() *
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
      (double) MILLIUNITS));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
  inline void update_remark_pause_counter() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
    _remark_pause_counter->set_value(
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
      (jlong) (cms_size_policy()-> avg_remark_pause()->last_sample() *
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
      (double) MILLIUNITS));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
  inline void update_avg_concurrent_time_counter() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
    _avg_concurrent_time_counter->set_value(
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
      (jlong) (cms_size_policy()->avg_concurrent_time()->last_sample() *
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
      (double) MILLIUNITS));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
  inline void update_avg_concurrent_interval_counter() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
    _avg_concurrent_interval_counter->set_value(
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
      (jlong) (cms_size_policy()->avg_concurrent_interval()->average() *
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
      (double) MILLIUNITS));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
  inline void update_avg_concurrent_gc_cost_counter() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
    _avg_concurrent_gc_cost_counter->set_value(
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
      (jlong) (cms_size_policy()->avg_concurrent_gc_cost()->average() * 100.0));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
  inline void update_avg_cms_free_counter() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
    _avg_cms_free_counter->set_value(
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
      (jlong) cms_size_policy()->avg_cms_free()->average());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
  inline void update_avg_cms_free_at_sweep_counter() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
    _avg_cms_free_at_sweep_counter->set_value(
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
      (jlong) cms_size_policy()->avg_cms_free_at_sweep()->average());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
  inline void update_avg_cms_promo_counter() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
    _avg_cms_promo_counter->set_value(
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
      (jlong) cms_size_policy()->avg_cms_promo()->average());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
  inline void update_avg_old_live_counter() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
    _avg_old_live_counter->set_value(
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
      (jlong)(cms_size_policy()->avg_old_live()->average())
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
    );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
  inline void update_avg_msc_pause_counter() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
    _avg_msc_pause_counter->set_value(
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
      (jlong) (cms_size_policy()->avg_msc_pause()->average() *
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
      (double) MILLIUNITS));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
  inline void update_avg_msc_interval_counter() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
    _avg_msc_interval_counter->set_value(
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
      (jlong) (cms_size_policy()->avg_msc_interval()->average() *
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
      (double) MILLIUNITS));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   217
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   218
489c9b5090e2 Initial load
duke
parents:
diff changeset
   219
  inline void update_msc_gc_cost_counter() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   220
    _msc_gc_cost_counter->set_value(
489c9b5090e2 Initial load
duke
parents:
diff changeset
   221
      (jlong) (cms_size_policy()->avg_msc_gc_cost()->average() * 100.0));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   222
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   223
489c9b5090e2 Initial load
duke
parents:
diff changeset
   224
  inline void update_avg_ms_pause_counter() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   225
    _avg_ms_pause_counter->set_value(
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
      (jlong) (cms_size_policy()->avg_ms_pause()->average() *
489c9b5090e2 Initial load
duke
parents:
diff changeset
   227
      (double) MILLIUNITS));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   229
489c9b5090e2 Initial load
duke
parents:
diff changeset
   230
  inline void update_avg_ms_interval_counter() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   231
    _avg_ms_interval_counter->set_value(
489c9b5090e2 Initial load
duke
parents:
diff changeset
   232
      (jlong) (cms_size_policy()->avg_ms_interval()->average() *
489c9b5090e2 Initial load
duke
parents:
diff changeset
   233
      (double) MILLIUNITS));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   234
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   235
489c9b5090e2 Initial load
duke
parents:
diff changeset
   236
  inline void update_ms_gc_cost_counter() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   237
    _ms_gc_cost_counter->set_value(
489c9b5090e2 Initial load
duke
parents:
diff changeset
   238
      (jlong) (cms_size_policy()->avg_ms_gc_cost()->average() * 100.0));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   239
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   240
489c9b5090e2 Initial load
duke
parents:
diff changeset
   241
  inline void update_major_gc_cost_counter() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   242
    _major_gc_cost_counter->set_value(
489c9b5090e2 Initial load
duke
parents:
diff changeset
   243
      (jlong)(cms_size_policy()->cms_gc_cost() * 100.0)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   244
    );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   245
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   246
  inline void update_mutator_cost_counter() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   247
    _mutator_cost_counter->set_value(
489c9b5090e2 Initial load
duke
parents:
diff changeset
   248
      (jlong)(cms_size_policy()->mutator_cost() * 100.0)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   249
    );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   250
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   251
489c9b5090e2 Initial load
duke
parents:
diff changeset
   252
  inline void update_avg_promoted_avg(CMSGCStats* gc_stats) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   253
    _promoted_avg_counter->set_value(
489c9b5090e2 Initial load
duke
parents:
diff changeset
   254
      (jlong)(gc_stats->avg_promoted()->average())
489c9b5090e2 Initial load
duke
parents:
diff changeset
   255
    );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   256
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   257
  inline void update_avg_promoted_dev(CMSGCStats* gc_stats) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   258
    _promoted_avg_dev_counter->set_value(
489c9b5090e2 Initial load
duke
parents:
diff changeset
   259
      (jlong)(gc_stats->avg_promoted()->deviation())
489c9b5090e2 Initial load
duke
parents:
diff changeset
   260
    );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   261
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   262
  inline void update_avg_promoted_padded_avg(CMSGCStats* gc_stats) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   263
    _promoted_padded_avg_counter->set_value(
489c9b5090e2 Initial load
duke
parents:
diff changeset
   264
      (jlong)(gc_stats->avg_promoted()->padded_average())
489c9b5090e2 Initial load
duke
parents:
diff changeset
   265
    );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   266
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   267
  inline void update_remark_pause_old_slope_counter() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   268
    _remark_pause_old_slope_counter->set_value(
489c9b5090e2 Initial load
duke
parents:
diff changeset
   269
      (jlong)(cms_size_policy()->remark_pause_old_slope() * 1000)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   270
    );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   271
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   272
  inline void update_initial_pause_old_slope_counter() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   273
    _initial_pause_old_slope_counter->set_value(
489c9b5090e2 Initial load
duke
parents:
diff changeset
   274
      (jlong)(cms_size_policy()->initial_pause_old_slope() * 1000)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   275
    );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   276
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   277
  inline void update_remark_pause_young_slope_counter() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   278
    _remark_pause_young_slope_counter->set_value(
489c9b5090e2 Initial load
duke
parents:
diff changeset
   279
      (jlong)(cms_size_policy()->remark_pause_young_slope() * 1000)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   280
    );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   281
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   282
  inline void update_initial_pause_young_slope_counter() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   283
    _initial_pause_young_slope_counter->set_value(
489c9b5090e2 Initial load
duke
parents:
diff changeset
   284
      (jlong)(cms_size_policy()->initial_pause_young_slope() * 1000)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   285
    );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   286
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   287
  inline void update_change_young_gen_for_maj_pauses() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   288
    _change_young_gen_for_maj_pauses_counter->set_value(
489c9b5090e2 Initial load
duke
parents:
diff changeset
   289
      cms_size_policy()->change_young_gen_for_maj_pauses());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   290
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   291
489c9b5090e2 Initial load
duke
parents:
diff changeset
   292
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   293
  CMSGCAdaptivePolicyCounters(const char* name, int collectors, int generations,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   294
                              AdaptiveSizePolicy* size_policy);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   295
489c9b5090e2 Initial load
duke
parents:
diff changeset
   296
  // update counters
489c9b5090e2 Initial load
duke
parents:
diff changeset
   297
  void update_counters();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   298
  void update_counters(CMSGCStats* gc_stats);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   299
  void update_counters_from_policy();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   300
489c9b5090e2 Initial load
duke
parents:
diff changeset
   301
  inline void update_cms_capacity_counter(size_t size_in_bytes) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   302
    _cms_capacity_counter->set_value(size_in_bytes);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   303
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   304
489c9b5090e2 Initial load
duke
parents:
diff changeset
   305
  virtual GCPolicyCounters::Name kind() const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   306
    return GCPolicyCounters::CMSGCAdaptivePolicyCountersKind;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   307
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   308
};
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   309
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   310
#endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSGCADAPTIVEPOLICYCOUNTERS_HPP