comparison src/share/vm/gc_implementation/shared/generationCounters.hpp @ 3980: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
comparison
equal deleted inserted replaced
3979:4dfb2df418f2 3980:8229bd737950
32 // that track a generation 32 // that track a generation
33 33
34 class GenerationCounters: public CHeapObj { 34 class GenerationCounters: public CHeapObj {
35 friend class VMStructs; 35 friend class VMStructs;
36 36
37 private:
38 void initialize(const char* name, int ordinal, int spaces,
39 size_t min_capacity, size_t max_capacity,
40 size_t curr_capacity);
41
37 protected: 42 protected:
38 PerfVariable* _current_size; 43 PerfVariable* _current_size;
39 VirtualSpace* _virtual_space; 44 VirtualSpace* _virtual_space;
40 45
41 // Constant PerfData types don't need to retain a reference. 46 // Constant PerfData types don't need to retain a reference.
46 // PerfConstant* _spaces; 51 // PerfConstant* _spaces;
47 52
48 char* _name_space; 53 char* _name_space;
49 54
50 // This constructor is only meant for use with the PSGenerationCounters 55 // This constructor is only meant for use with the PSGenerationCounters
51 // constructor. The need for such an constructor should be eliminated 56 // constructor. The need for such an constructor should be eliminated
52 // when VirtualSpace and PSVirtualSpace are unified. 57 // when VirtualSpace and PSVirtualSpace are unified.
53 GenerationCounters() : _name_space(NULL), _current_size(NULL), _virtual_space(NULL) {} 58 GenerationCounters()
59 : _name_space(NULL), _current_size(NULL), _virtual_space(NULL) {}
60
61 // This constructor is used for subclasses that do not have a space
62 // associated with them (e.g, in G1).
63 GenerationCounters(const char* name, int ordinal, int spaces,
64 size_t min_capacity, size_t max_capacity,
65 size_t curr_capacity);
66
54 public: 67 public:
55
56 GenerationCounters(const char* name, int ordinal, int spaces, 68 GenerationCounters(const char* name, int ordinal, int spaces,
57 VirtualSpace* v); 69 VirtualSpace* v);
58 70
59 ~GenerationCounters() { 71 ~GenerationCounters() {
60 if (_name_space != NULL) FREE_C_HEAP_ARRAY(char, _name_space); 72 if (_name_space != NULL) FREE_C_HEAP_ARRAY(char, _name_space);
61 } 73 }
62 74
63 virtual void update_all() { 75 virtual void update_all();
64 _current_size->set_value(_virtual_space == NULL ? 0 :
65 _virtual_space->committed_size());
66 }
67 76
68 const char* name_space() const { return _name_space; } 77 const char* name_space() const { return _name_space; }
69 78
70 }; 79 };
71 #endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_GENERATIONCOUNTERS_HPP 80 #endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_GENERATIONCOUNTERS_HPP