src/share/vm/gc_implementation/shared/ageTable.cpp

Print this page


   1 /*
   2  * Copyright (c) 1997, 2009, 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 /* Copyright (c) 1992-2009 Oracle and/or its affiliates, and Stanford University.
  26    See the LICENSE file for license information. */
  27 
  28 # include "incls/_precompiled.incl"
  29 # include "incls/_ageTable.cpp.incl"
  30 
  31 ageTable::ageTable(bool global) {
  32 
  33   clear();
  34 
  35   if (UsePerfData && global) {
  36 
  37     ResourceMark rm;
  38     EXCEPTION_MARK;
  39 
  40     const char* agetable_ns = "generation.0.agetable";
  41     const char* bytes_ns = PerfDataManager::name_space(agetable_ns, "bytes");
  42 
  43     for(int age = 0; age < table_size; age ++) {
  44       char age_name[10];
  45       jio_snprintf(age_name, sizeof(age_name), "%2.2d", age);
  46       const char* cname = PerfDataManager::counter_name(bytes_ns, age_name);
  47       _perf_sizes[age] = PerfDataManager::create_variable(SUN_GC, cname,
  48                                                           PerfData::U_Bytes,
  49                                                           CHECK);
  50     }


   1 /*
   2  * Copyright (c) 1997, 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 #include "precompiled.hpp"
  26 #include "gc_implementation/shared/ageTable.hpp"
  27 #include "gc_implementation/shared/gcPolicyCounters.hpp"
  28 #include "memory/collectorPolicy.hpp"
  29 #include "memory/resourceArea.hpp"
  30 #include "memory/sharedHeap.hpp"
  31 #include "utilities/copy.hpp"
  32 
  33 /* Copyright (c) 1992-2009 Oracle and/or its affiliates, and Stanford University.
  34    See the LICENSE file for license information. */
  35 



  36 ageTable::ageTable(bool global) {
  37 
  38   clear();
  39 
  40   if (UsePerfData && global) {
  41 
  42     ResourceMark rm;
  43     EXCEPTION_MARK;
  44 
  45     const char* agetable_ns = "generation.0.agetable";
  46     const char* bytes_ns = PerfDataManager::name_space(agetable_ns, "bytes");
  47 
  48     for(int age = 0; age < table_size; age ++) {
  49       char age_name[10];
  50       jio_snprintf(age_name, sizeof(age_name), "%2.2d", age);
  51       const char* cname = PerfDataManager::counter_name(bytes_ns, age_name);
  52       _perf_sizes[age] = PerfDataManager::create_variable(SUN_GC, cname,
  53                                                           PerfData::U_Bytes,
  54                                                           CHECK);
  55     }