annotate src/share/vm/gc_implementation/shared/generationCounters.hpp @ 2741:8229bd737950

7075646: G1: fix inconsistencies in the monitoring data Summary: Fixed a few inconsistencies in the monitoring data, in particular when reported from jstat. Reviewed-by: jmasa, brutisso, johnc
author tonyp
date Fri, 23 Sep 2011 16:07:49 -0400
parents b52782ae3880
children d2a62e0f25eb
rev   line source
duke@0 1 /*
jmasa@2386 2 * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
duke@0 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@0 4 *
duke@0 5 * This code is free software; you can redistribute it and/or modify it
duke@0 6 * under the terms of the GNU General Public License version 2 only, as
duke@0 7 * published by the Free Software Foundation.
duke@0 8 *
duke@0 9 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@0 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@0 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@0 12 * version 2 for more details (a copy is included in the LICENSE file that
duke@0 13 * accompanied this code).
duke@0 14 *
duke@0 15 * You should have received a copy of the GNU General Public License version
duke@0 16 * 2 along with this work; if not, write to the Free Software Foundation,
duke@0 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@0 18 *
trims@1472 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@1472 20 * or visit www.oracle.com if you need additional information or have any
trims@1472 21 * questions.
duke@0 22 *
duke@0 23 */
duke@0 24
stefank@1879 25 #ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_GENERATIONCOUNTERS_HPP
stefank@1879 26 #define SHARE_VM_GC_IMPLEMENTATION_SHARED_GENERATIONCOUNTERS_HPP
stefank@1879 27
stefank@1879 28 #include "runtime/perfData.hpp"
stefank@1879 29 #include "runtime/virtualspace.hpp"
stefank@1879 30
duke@0 31 // A GenerationCounter is a holder class for performance counters
duke@0 32 // that track a generation
duke@0 33
duke@0 34 class GenerationCounters: public CHeapObj {
duke@0 35 friend class VMStructs;
duke@0 36
tonyp@2741 37 private:
tonyp@2741 38 void initialize(const char* name, int ordinal, int spaces,
tonyp@2741 39 size_t min_capacity, size_t max_capacity,
tonyp@2741 40 size_t curr_capacity);
tonyp@2741 41
duke@0 42 protected:
duke@0 43 PerfVariable* _current_size;
duke@0 44 VirtualSpace* _virtual_space;
duke@0 45
duke@0 46 // Constant PerfData types don't need to retain a reference.
duke@0 47 // However, it's a good idea to document them here.
duke@0 48 // PerfStringConstant* _name;
duke@0 49 // PerfConstant* _min_size;
duke@0 50 // PerfConstant* _max_size;
duke@0 51 // PerfConstant* _spaces;
duke@0 52
duke@0 53 char* _name_space;
duke@0 54
duke@0 55 // This constructor is only meant for use with the PSGenerationCounters
tonyp@2741 56 // constructor. The need for such an constructor should be eliminated
duke@0 57 // when VirtualSpace and PSVirtualSpace are unified.
tonyp@2741 58 GenerationCounters()
tonyp@2741 59 : _name_space(NULL), _current_size(NULL), _virtual_space(NULL) {}
tonyp@2741 60
tonyp@2741 61 // This constructor is used for subclasses that do not have a space
tonyp@2741 62 // associated with them (e.g, in G1).
tonyp@2741 63 GenerationCounters(const char* name, int ordinal, int spaces,
tonyp@2741 64 size_t min_capacity, size_t max_capacity,
tonyp@2741 65 size_t curr_capacity);
tonyp@2741 66
duke@0 67 public:
duke@0 68 GenerationCounters(const char* name, int ordinal, int spaces,
duke@0 69 VirtualSpace* v);
duke@0 70
duke@0 71 ~GenerationCounters() {
duke@0 72 if (_name_space != NULL) FREE_C_HEAP_ARRAY(char, _name_space);
duke@0 73 }
duke@0 74
tonyp@2741 75 virtual void update_all();
duke@0 76
duke@0 77 const char* name_space() const { return _name_space; }
jmasa@2386 78
duke@0 79 };
stefank@1879 80 #endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_GENERATIONCOUNTERS_HPP