src/share/vm/gc_implementation/parallelScavenge/psGCAdaptivePolicyCounters.cpp

Fri, 16 Jul 2010 21:33:21 -0700

author
jcoomes
date
Fri, 16 Jul 2010 21:33:21 -0700
changeset 2020
a93a9eda13f7
parent 1907
c18cbe5936b8
child 2314
f95d63e2154a
permissions
-rw-r--r--

6962947: shared TaskQueue statistics
Reviewed-by: tonyp, ysr

     1 /*
     2  * Copyright (c) 2003, 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  */
    25 # include "incls/_precompiled.incl"
    26 # include "incls/_psGCAdaptivePolicyCounters.cpp.incl"
    30 PSGCAdaptivePolicyCounters::PSGCAdaptivePolicyCounters(const char* name_arg,
    31                                       int collectors,
    32                                       int generations,
    33                                       PSAdaptiveSizePolicy* size_policy_arg)
    34         : GCAdaptivePolicyCounters(name_arg,
    35                                    collectors,
    36                                    generations,
    37                                    size_policy_arg) {
    38   if (UsePerfData) {
    39     EXCEPTION_MARK;
    40     ResourceMark rm;
    42     const char* cname;
    44     cname = PerfDataManager::counter_name(name_space(), "oldPromoSize");
    45     _old_promo_size = PerfDataManager::create_variable(SUN_GC, cname,
    46       PerfData::U_Bytes, ps_size_policy()->calculated_promo_size_in_bytes(), CHECK);
    48     cname = PerfDataManager::counter_name(name_space(), "oldEdenSize");
    49     _old_eden_size = PerfDataManager::create_variable(SUN_GC, cname,
    50       PerfData::U_Bytes, ps_size_policy()->calculated_eden_size_in_bytes(), CHECK);
    52     cname = PerfDataManager::counter_name(name_space(), "oldCapacity");
    53     _old_capacity = PerfDataManager::create_variable(SUN_GC, cname,
    54       PerfData::U_Bytes, (jlong) InitialHeapSize, CHECK);
    56     cname = PerfDataManager::counter_name(name_space(), "boundaryMoved");
    57     _boundary_moved = PerfDataManager::create_variable(SUN_GC, cname,
    58       PerfData::U_Bytes, (jlong) 0, CHECK);
    60     cname = PerfDataManager::counter_name(name_space(), "avgPromotedAvg");
    61     _avg_promoted_avg_counter =
    62       PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Bytes,
    63         ps_size_policy()->calculated_promo_size_in_bytes(), CHECK);
    65     cname = PerfDataManager::counter_name(name_space(), "avgPromotedDev");
    66     _avg_promoted_dev_counter =
    67       PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Bytes,
    68         (jlong) 0 , CHECK);
    70     cname = PerfDataManager::counter_name(name_space(), "avgPromotedPaddedAvg");
    71     _avg_promoted_padded_avg_counter =
    72       PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Bytes,
    73         ps_size_policy()->calculated_promo_size_in_bytes(), CHECK);
    75     cname = PerfDataManager::counter_name(name_space(),
    76       "avgPretenuredPaddedAvg");
    77     _avg_pretenured_padded_avg =
    78       PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Bytes,
    79         (jlong) 0, CHECK);
    82     cname = PerfDataManager::counter_name(name_space(),
    83       "changeYoungGenForMajPauses");
    84     _change_young_gen_for_maj_pauses_counter =
    85       PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Events,
    86         (jlong)0, CHECK);
    88     cname = PerfDataManager::counter_name(name_space(),
    89       "changeOldGenForMinPauses");
    90     _change_old_gen_for_min_pauses =
    91       PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Events,
    92         (jlong)0, CHECK);
    95     cname = PerfDataManager::counter_name(name_space(), "avgMajorPauseTime");
    96     _avg_major_pause = PerfDataManager::create_variable(SUN_GC, cname,
    97       PerfData::U_Ticks, (jlong) ps_size_policy()->_avg_major_pause->average(), CHECK);
    99     cname = PerfDataManager::counter_name(name_space(), "avgMajorIntervalTime");
   100     _avg_major_interval = PerfDataManager::create_variable(SUN_GC, cname,
   101       PerfData::U_Ticks, (jlong) ps_size_policy()->_avg_major_interval->average(), CHECK);
   103     cname = PerfDataManager::counter_name(name_space(), "majorGcCost");
   104     _major_gc_cost_counter = PerfDataManager::create_variable(SUN_GC, cname,
   105        PerfData::U_Ticks, (jlong) ps_size_policy()->major_gc_cost(), CHECK);
   107     cname = PerfDataManager::counter_name(name_space(), "liveSpace");
   108     _live_space = PerfDataManager::create_variable(SUN_GC, cname,
   109       PerfData::U_Bytes, ps_size_policy()->live_space(), CHECK);
   111     cname = PerfDataManager::counter_name(name_space(), "freeSpace");
   112     _free_space = PerfDataManager::create_variable(SUN_GC, cname,
   113       PerfData::U_Bytes, ps_size_policy()->free_space(), CHECK);
   115     cname = PerfDataManager::counter_name(name_space(), "avgBaseFootprint");
   116     _avg_base_footprint = PerfDataManager::create_variable(SUN_GC, cname,
   117       PerfData::U_Bytes, (jlong) ps_size_policy()->avg_base_footprint()->average(), CHECK);
   119     cname = PerfDataManager::counter_name(name_space(), "gcTimeLimitExceeded");
   120     _gc_overhead_limit_exceeded_counter =
   121       PerfDataManager::create_variable(SUN_GC, cname,
   122       PerfData::U_Events, ps_size_policy()->gc_overhead_limit_exceeded(), CHECK);
   124     cname = PerfDataManager::counter_name(name_space(), "liveAtLastFullGc");
   125     _live_at_last_full_gc_counter =
   126       PerfDataManager::create_variable(SUN_GC, cname,
   127       PerfData::U_Bytes, ps_size_policy()->live_at_last_full_gc(), CHECK);
   129     cname = PerfDataManager::counter_name(name_space(), "majorPauseOldSlope");
   130     _major_pause_old_slope = PerfDataManager::create_variable(SUN_GC, cname,
   131       PerfData::U_None, (jlong) 0, CHECK);
   133     cname = PerfDataManager::counter_name(name_space(), "minorPauseOldSlope");
   134     _minor_pause_old_slope = PerfDataManager::create_variable(SUN_GC, cname,
   135       PerfData::U_None, (jlong) 0, CHECK);
   137     cname = PerfDataManager::counter_name(name_space(), "majorPauseYoungSlope");
   138     _major_pause_young_slope = PerfDataManager::create_variable(SUN_GC, cname,
   139       PerfData::U_None, (jlong) 0, CHECK);
   141     cname = PerfDataManager::counter_name(name_space(), "scavengeSkipped");
   142     _scavenge_skipped = PerfDataManager::create_variable(SUN_GC, cname,
   143       PerfData::U_Bytes, (jlong) 0, CHECK);
   145     cname = PerfDataManager::counter_name(name_space(), "fullFollowsScavenge");
   146     _full_follows_scavenge = PerfDataManager::create_variable(SUN_GC, cname,
   147       PerfData::U_Bytes, (jlong) 0, CHECK);
   149     _counter_time_stamp.update();
   150   }
   152   assert(size_policy()->is_gc_ps_adaptive_size_policy(),
   153     "Wrong type of size policy");
   154 }
   156 void PSGCAdaptivePolicyCounters::update_counters_from_policy() {
   157   if (UsePerfData) {
   158     GCAdaptivePolicyCounters::update_counters_from_policy();
   159     update_eden_size();
   160     update_promo_size();
   161     update_avg_old_live();
   162     update_survivor_size_counters();
   163     update_avg_promoted_avg();
   164     update_avg_promoted_dev();
   165     update_avg_promoted_padded_avg();
   166     update_avg_pretenured_padded_avg();
   168     update_avg_major_pause();
   169     update_avg_major_interval();
   170     update_minor_gc_cost_counter();
   171     update_major_gc_cost_counter();
   172     update_mutator_cost_counter();
   173     update_decrement_tenuring_threshold_for_gc_cost();
   174     update_increment_tenuring_threshold_for_gc_cost();
   175     update_decrement_tenuring_threshold_for_survivor_limit();
   176     update_live_space();
   177     update_free_space();
   178     update_avg_base_footprint();
   180     update_change_old_gen_for_maj_pauses();
   181     update_change_young_gen_for_maj_pauses();
   182     update_change_old_gen_for_min_pauses();
   184     update_change_old_gen_for_throughput();
   185     update_change_young_gen_for_throughput();
   187     update_decrease_for_footprint();
   188     update_decide_at_full_gc_counter();
   190     update_major_pause_old_slope();
   191     update_minor_pause_old_slope();
   192     update_major_pause_young_slope();
   193     update_minor_collection_slope_counter();
   194     update_gc_overhead_limit_exceeded_counter();
   195     update_live_at_last_full_gc_counter();
   196   }
   197 }
   199 void PSGCAdaptivePolicyCounters::update_counters() {
   200   if (UsePerfData) {
   201     update_counters_from_policy();
   202   }
   203 }

mercurial