comparison src/share/vm/gc_implementation/shared/spaceCounters.hpp @ 6197:d2a62e0f25eb

6995781: Native Memory Tracking (Phase 1) 7151532: DCmd for hotspot native memory tracking Summary: Implementation of native memory tracking phase 1, which tracks VM native memory usage, and related DCmd Reviewed-by: acorn, coleenp, fparain
author zgu
date Thu, 28 Jun 2012 17:03:16 -0400
parents f95d63e2154a
children b9a9ed0f8eeb
comparison
equal deleted inserted replaced
6174:74533f63b116 6197:d2a62e0f25eb
33 #endif 33 #endif
34 34
35 // A SpaceCounter is a holder class for performance counters 35 // A SpaceCounter is a holder class for performance counters
36 // that track a space; 36 // that track a space;
37 37
38 class SpaceCounters: public CHeapObj { 38 class SpaceCounters: public CHeapObj<mtGC> {
39 friend class VMStructs; 39 friend class VMStructs;
40 40
41 private: 41 private:
42 PerfVariable* _capacity; 42 PerfVariable* _capacity;
43 PerfVariable* _used; 43 PerfVariable* _used;
53 53
54 SpaceCounters(const char* name, int ordinal, size_t max_size, 54 SpaceCounters(const char* name, int ordinal, size_t max_size,
55 MutableSpace* m, GenerationCounters* gc); 55 MutableSpace* m, GenerationCounters* gc);
56 56
57 ~SpaceCounters() { 57 ~SpaceCounters() {
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() { 61 inline void update_capacity() {
62 _capacity->set_value(_object_space->capacity_in_bytes()); 62 _capacity->set_value(_object_space->capacity_in_bytes());
63 } 63 }