35 // that track a collections (logical spaces) in a heap; |
35 // that track a collections (logical spaces) in a heap; |
36 |
36 |
37 class HeapSpaceUsedHelper; |
37 class HeapSpaceUsedHelper; |
38 class G1SpaceMonitoringSupport; |
38 class G1SpaceMonitoringSupport; |
39 |
39 |
40 class HSpaceCounters: public CHeapObj { |
40 class HSpaceCounters: public CHeapObj<mtGC> { |
41 friend class VMStructs; |
41 friend class VMStructs; |
42 |
42 |
43 private: |
43 private: |
44 PerfVariable* _capacity; |
44 PerfVariable* _capacity; |
45 PerfVariable* _used; |
45 PerfVariable* _used; |
53 |
53 |
54 HSpaceCounters(const char* name, int ordinal, size_t max_size, |
54 HSpaceCounters(const char* name, int ordinal, size_t max_size, |
55 size_t initial_capacity, GenerationCounters* gc); |
55 size_t initial_capacity, GenerationCounters* gc); |
56 |
56 |
57 ~HSpaceCounters() { |
57 ~HSpaceCounters() { |
58 if (_name_space != NULL) FREE_C_HEAP_ARRAY(char, _name_space); |
58 if (_name_space != NULL) FREE_C_HEAP_ARRAY(char, _name_space, mtGC); |
59 } |
59 } |
60 |
60 |
61 inline void update_capacity(size_t v) { |
61 inline void update_capacity(size_t v) { |
62 _capacity->set_value(v); |
62 _capacity->set_value(v); |
63 } |
63 } |