hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.cpp
author kvn
Thu, 27 May 2010 18:01:56 -0700
changeset 5694 1e0532a6abff
parent 1 489c9b5090e2
child 5547 f4b087cbb361
permissions -rw-r--r--
6916623: Align object to 16 bytes to use Compressed Oops with java heap up to 64Gb Summary: Added new product ObjectAlignmentInBytes flag to control object alignment. Reviewed-by: twisti, ysr, iveresov
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
489c9b5090e2 Initial load
duke
parents:
diff changeset
     2
 * Copyright 2004-2005 Sun Microsystems, Inc.  All Rights Reserved.
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
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    19
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    20
 * CA 95054 USA or visit www.sun.com if you need additional information or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    21
 * have any questions.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
489c9b5090e2 Initial load
duke
parents:
diff changeset
    25
# include "incls/_precompiled.incl"
489c9b5090e2 Initial load
duke
parents:
diff changeset
    26
# include "incls/_cmsGCAdaptivePolicyCounters.cpp.incl"
489c9b5090e2 Initial load
duke
parents:
diff changeset
    27
489c9b5090e2 Initial load
duke
parents:
diff changeset
    28
CMSGCAdaptivePolicyCounters::CMSGCAdaptivePolicyCounters(const char* name_arg,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    29
                                        int collectors,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    30
                                        int generations,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
                                        AdaptiveSizePolicy* size_policy_arg)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
        : GCAdaptivePolicyCounters(name_arg,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
                                   collectors,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
                                   generations,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
                                   size_policy_arg) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
  if (UsePerfData) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
    EXCEPTION_MARK;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
    ResourceMark rm;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
    const char* cname =
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
      PerfDataManager::counter_name(name_space(), "cmsCapacity");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
    _cms_capacity_counter = PerfDataManager::create_variable(SUN_GC, cname,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
      PerfData::U_Bytes, (jlong) OldSize, CHECK);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
#ifdef NOT_PRODUCT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
    cname =
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
      PerfDataManager::counter_name(name_space(), "initialPause");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
    _initial_pause_counter = PerfDataManager::create_variable(SUN_GC, cname,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
      PerfData::U_Ticks,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
      (jlong) cms_size_policy()->avg_initial_pause()->last_sample(),
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
      CHECK);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
    cname = PerfDataManager::counter_name(name_space(), "remarkPause");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
    _remark_pause_counter = PerfDataManager::create_variable(SUN_GC, cname,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
      PerfData::U_Ticks,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
      (jlong) cms_size_policy()->avg_remark_pause()->last_sample(),
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
      CHECK);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
    cname =
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
      PerfDataManager::counter_name(name_space(), "avgInitialPause");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
    _avg_initial_pause_counter = PerfDataManager::create_variable(SUN_GC, cname,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
      PerfData::U_Ticks,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
      (jlong) cms_size_policy()->avg_initial_pause()->average(),
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
      CHECK);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
    cname = PerfDataManager::counter_name(name_space(), "avgRemarkPause");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
    _avg_remark_pause_counter = PerfDataManager::create_variable(SUN_GC, cname,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
    PerfData::U_Ticks,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
      (jlong) cms_size_policy()->avg_remark_pause()->average(),
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
      CHECK);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
    cname = PerfDataManager::counter_name(name_space(), "avgSTWGcCost");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
    _avg_cms_STW_gc_cost_counter = PerfDataManager::create_variable(SUN_GC,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
        cname,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
        PerfData::U_Ticks,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
      (jlong) cms_size_policy()->avg_cms_STW_gc_cost()->average(),
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
        CHECK);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
    cname = PerfDataManager::counter_name(name_space(), "avgSTWTime");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
    _avg_cms_STW_time_counter = PerfDataManager::create_variable(SUN_GC,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
        cname,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
        PerfData::U_Ticks,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
      (jlong) cms_size_policy()->avg_cms_STW_time()->average(),
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
        CHECK);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
    cname = PerfDataManager::counter_name(name_space(), "avgConcurrentTime");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
    _avg_concurrent_time_counter = PerfDataManager::create_variable(SUN_GC,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
        cname,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
        PerfData::U_Ticks,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
        (jlong) cms_size_policy()->avg_concurrent_time()->average(),
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
        CHECK);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
    cname =
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
      PerfDataManager::counter_name(name_space(), "avgConcurrentInterval");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
    _avg_concurrent_interval_counter = PerfDataManager::create_variable(SUN_GC,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
        cname,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
        PerfData::U_Ticks,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
        (jlong) cms_size_policy()->avg_concurrent_interval()->average(),
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
        CHECK);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
    cname = PerfDataManager::counter_name(name_space(), "avgConcurrentGcCost");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
    _avg_concurrent_gc_cost_counter = PerfDataManager::create_variable(SUN_GC,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
        cname,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
        PerfData::U_Ticks,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
        (jlong) cms_size_policy()->avg_concurrent_gc_cost()->average(),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
        CHECK);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
    cname = PerfDataManager::counter_name(name_space(), "avgCMSFreeAtSweep");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
    _avg_cms_free_at_sweep_counter = PerfDataManager::create_variable(SUN_GC,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
        cname,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
        PerfData::U_Ticks,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
        (jlong) cms_size_policy()->avg_cms_free_at_sweep()->average(),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
        CHECK);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
    cname = PerfDataManager::counter_name(name_space(), "avgCMSFree");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
    _avg_cms_free_counter = PerfDataManager::create_variable(SUN_GC,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
        cname,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
        PerfData::U_Ticks,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
        (jlong) cms_size_policy()->avg_cms_free()->average(),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
        CHECK);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
    cname = PerfDataManager::counter_name(name_space(), "avgCMSPromo");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
    _avg_cms_promo_counter = PerfDataManager::create_variable(SUN_GC,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
        cname,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
        PerfData::U_Ticks,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
        (jlong) cms_size_policy()->avg_cms_promo()->average(),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
        CHECK);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
    cname = PerfDataManager::counter_name(name_space(), "avgMscPause");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
    _avg_msc_pause_counter = PerfDataManager::create_variable(SUN_GC,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
        cname,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
        PerfData::U_Ticks,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
        (jlong) cms_size_policy()->avg_msc_pause()->average(),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
        CHECK);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
    cname = PerfDataManager::counter_name(name_space(), "avgMscInterval");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
    _avg_msc_interval_counter = PerfDataManager::create_variable(SUN_GC,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
        cname,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
        PerfData::U_Ticks,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
        (jlong) cms_size_policy()->avg_msc_interval()->average(),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
        CHECK);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
    cname = PerfDataManager::counter_name(name_space(), "mscGcCost");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
    _msc_gc_cost_counter = PerfDataManager::create_variable(SUN_GC,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
        cname,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
        PerfData::U_Ticks,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
        (jlong) cms_size_policy()->avg_msc_gc_cost()->average(),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
        CHECK);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
    cname = PerfDataManager::counter_name(name_space(), "avgMsPause");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
    _avg_ms_pause_counter = PerfDataManager::create_variable(SUN_GC,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
        cname,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
        PerfData::U_Ticks,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
        (jlong) cms_size_policy()->avg_ms_pause()->average(),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
        CHECK);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
    cname = PerfDataManager::counter_name(name_space(), "avgMsInterval");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
    _avg_ms_interval_counter = PerfDataManager::create_variable(SUN_GC,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
        cname,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
        PerfData::U_Ticks,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
        (jlong) cms_size_policy()->avg_ms_interval()->average(),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
        CHECK);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
    cname = PerfDataManager::counter_name(name_space(), "msGcCost");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
    _ms_gc_cost_counter = PerfDataManager::create_variable(SUN_GC,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
        cname,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
        PerfData::U_Ticks,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
        (jlong) cms_size_policy()->avg_ms_gc_cost()->average(),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
        CHECK);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
    cname = PerfDataManager::counter_name(name_space(), "majorGcCost");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
    _major_gc_cost_counter = PerfDataManager::create_variable(SUN_GC, cname,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
       PerfData::U_Ticks, (jlong) cms_size_policy()->cms_gc_cost(), CHECK);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
    cname = PerfDataManager::counter_name(name_space(), "avgPromotedAvg");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
    _promoted_avg_counter =
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
      PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Bytes,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
        cms_size_policy()->calculated_promo_size_in_bytes(), CHECK);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
    cname = PerfDataManager::counter_name(name_space(), "avgPromotedDev");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
    _promoted_avg_dev_counter =
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
      PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Bytes,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
        (jlong) 0 , CHECK);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
    cname = PerfDataManager::counter_name(name_space(), "avgPromotedPaddedAvg");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
    _promoted_padded_avg_counter =
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
      PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Bytes,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
        cms_size_policy()->calculated_promo_size_in_bytes(), CHECK);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
    cname = PerfDataManager::counter_name(name_space(),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
      "changeYoungGenForMajPauses");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
    _change_young_gen_for_maj_pauses_counter =
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
      PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Events,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
        (jlong)0, CHECK);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
    cname = PerfDataManager::counter_name(name_space(), "remarkPauseOldSlope");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
    _remark_pause_old_slope_counter =
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
      PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Bytes,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
        (jlong) cms_size_policy()->remark_pause_old_slope(), CHECK);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
    cname = PerfDataManager::counter_name(name_space(), "initialPauseOldSlope");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
    _initial_pause_old_slope_counter =
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
      PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Bytes,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
        (jlong) cms_size_policy()->initial_pause_old_slope(), CHECK);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
    cname =
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
      PerfDataManager::counter_name(name_space(), "remarkPauseYoungSlope") ;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
    _remark_pause_young_slope_counter =
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
      PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Bytes,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
        (jlong) cms_size_policy()->remark_pause_young_slope(), CHECK);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
    cname =
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
      PerfDataManager::counter_name(name_space(), "initialPauseYoungSlope");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
    _initial_pause_young_slope_counter =
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
      PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Bytes,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
        (jlong) cms_size_policy()->initial_pause_young_slope(), CHECK);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   217
489c9b5090e2 Initial load
duke
parents:
diff changeset
   218
489c9b5090e2 Initial load
duke
parents:
diff changeset
   219
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   220
  assert(size_policy()->is_gc_cms_adaptive_size_policy(),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   221
    "Wrong type of size policy");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   222
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   223
489c9b5090e2 Initial load
duke
parents:
diff changeset
   224
void CMSGCAdaptivePolicyCounters::update_counters() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   225
  if (UsePerfData) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
    GCAdaptivePolicyCounters::update_counters_from_policy();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   227
    update_counters_from_policy();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   229
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   230
489c9b5090e2 Initial load
duke
parents:
diff changeset
   231
void CMSGCAdaptivePolicyCounters::update_counters(CMSGCStats* gc_stats) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   232
  if (UsePerfData) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   233
    update_counters();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   234
    update_promoted((size_t) gc_stats->avg_promoted()->last_sample());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   235
    update_avg_promoted_avg(gc_stats);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   236
    update_avg_promoted_dev(gc_stats);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   237
    update_avg_promoted_padded_avg(gc_stats);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   238
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   239
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   240
489c9b5090e2 Initial load
duke
parents:
diff changeset
   241
void CMSGCAdaptivePolicyCounters::update_counters_from_policy() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   242
  if (UsePerfData && (cms_size_policy() != NULL)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   243
489c9b5090e2 Initial load
duke
parents:
diff changeset
   244
    GCAdaptivePolicyCounters::update_counters_from_policy();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   245
489c9b5090e2 Initial load
duke
parents:
diff changeset
   246
    update_major_gc_cost_counter();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   247
    update_mutator_cost_counter();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   248
489c9b5090e2 Initial load
duke
parents:
diff changeset
   249
    update_eden_size();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   250
    update_promo_size();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   251
489c9b5090e2 Initial load
duke
parents:
diff changeset
   252
    // If these updates from the last_sample() work,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   253
    // revise the update methods for these counters
489c9b5090e2 Initial load
duke
parents:
diff changeset
   254
    // (both here and in PS).
489c9b5090e2 Initial load
duke
parents:
diff changeset
   255
    update_survived((size_t) cms_size_policy()->avg_survived()->last_sample());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   256
489c9b5090e2 Initial load
duke
parents:
diff changeset
   257
    update_avg_concurrent_time_counter();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   258
    update_avg_concurrent_interval_counter();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   259
    update_avg_concurrent_gc_cost_counter();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   260
#ifdef NOT_PRODUCT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   261
    update_initial_pause_counter();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   262
    update_remark_pause_counter();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   263
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   264
    update_avg_initial_pause_counter();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   265
    update_avg_remark_pause_counter();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   266
489c9b5090e2 Initial load
duke
parents:
diff changeset
   267
    update_avg_cms_STW_time_counter();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   268
    update_avg_cms_STW_gc_cost_counter();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   269
489c9b5090e2 Initial load
duke
parents:
diff changeset
   270
    update_avg_cms_free_counter();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   271
    update_avg_cms_free_at_sweep_counter();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   272
    update_avg_cms_promo_counter();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   273
489c9b5090e2 Initial load
duke
parents:
diff changeset
   274
    update_avg_msc_pause_counter();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   275
    update_avg_msc_interval_counter();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   276
    update_msc_gc_cost_counter();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   277
489c9b5090e2 Initial load
duke
parents:
diff changeset
   278
    update_avg_ms_pause_counter();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   279
    update_avg_ms_interval_counter();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   280
    update_ms_gc_cost_counter();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   281
489c9b5090e2 Initial load
duke
parents:
diff changeset
   282
    update_avg_old_live_counter();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   283
489c9b5090e2 Initial load
duke
parents:
diff changeset
   284
    update_survivor_size_counters();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   285
    update_avg_survived_avg_counters();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   286
    update_avg_survived_dev_counters();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   287
489c9b5090e2 Initial load
duke
parents:
diff changeset
   288
    update_decrement_tenuring_threshold_for_gc_cost();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   289
    update_increment_tenuring_threshold_for_gc_cost();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   290
    update_decrement_tenuring_threshold_for_survivor_limit();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   291
489c9b5090e2 Initial load
duke
parents:
diff changeset
   292
    update_change_young_gen_for_maj_pauses();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   293
489c9b5090e2 Initial load
duke
parents:
diff changeset
   294
    update_major_collection_slope_counter();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   295
    update_remark_pause_old_slope_counter();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   296
    update_initial_pause_old_slope_counter();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   297
    update_remark_pause_young_slope_counter();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   298
    update_initial_pause_young_slope_counter();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   299
489c9b5090e2 Initial load
duke
parents:
diff changeset
   300
    update_decide_at_full_gc_counter();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   301
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   302
}