32 #endif |
32 #endif |
33 |
33 |
34 // A GSpaceCounter is a holder class for performance counters |
34 // A GSpaceCounter is a holder class for performance counters |
35 // that track a space; |
35 // that track a space; |
36 |
36 |
37 class GSpaceCounters: public CHeapObj { |
37 class GSpaceCounters: public CHeapObj<mtGC> { |
38 friend class VMStructs; |
38 friend class VMStructs; |
39 |
39 |
40 private: |
40 private: |
41 PerfVariable* _capacity; |
41 PerfVariable* _capacity; |
42 PerfVariable* _used; |
42 PerfVariable* _used; |
52 |
52 |
53 GSpaceCounters(const char* name, int ordinal, size_t max_size, Generation* g, |
53 GSpaceCounters(const char* name, int ordinal, size_t max_size, Generation* g, |
54 GenerationCounters* gc, bool sampled=true); |
54 GenerationCounters* gc, bool sampled=true); |
55 |
55 |
56 ~GSpaceCounters() { |
56 ~GSpaceCounters() { |
57 if (_name_space != NULL) FREE_C_HEAP_ARRAY(char, _name_space); |
57 if (_name_space != NULL) FREE_C_HEAP_ARRAY(char, _name_space, mtGC); |
58 } |
58 } |
59 |
59 |
60 inline void update_capacity() { |
60 inline void update_capacity() { |
61 _capacity->set_value(_gen->capacity()); |
61 _capacity->set_value(_gen->capacity()); |
62 } |
62 } |