comparison src/share/vm/memory/heapInspection.cpp @ 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 1d1603768966
children da91efe96a93
comparison
equal deleted inserted replaced
6174:74533f63b116 6197:d2a62e0f25eb
114 } 114 }
115 115
116 KlassInfoTable::KlassInfoTable(int size, HeapWord* ref) { 116 KlassInfoTable::KlassInfoTable(int size, HeapWord* ref) {
117 _size = 0; 117 _size = 0;
118 _ref = ref; 118 _ref = ref;
119 _buckets = NEW_C_HEAP_ARRAY(KlassInfoBucket, size); 119 _buckets = NEW_C_HEAP_ARRAY(KlassInfoBucket, size, mtInternal);
120 if (_buckets != NULL) { 120 if (_buckets != NULL) {
121 _size = size; 121 _size = size;
122 for (int index = 0; index < _size; index++) { 122 for (int index = 0; index < _size; index++) {
123 _buckets[index].initialize(); 123 _buckets[index].initialize();
124 } 124 }
128 KlassInfoTable::~KlassInfoTable() { 128 KlassInfoTable::~KlassInfoTable() {
129 if (_buckets != NULL) { 129 if (_buckets != NULL) {
130 for (int index = 0; index < _size; index++) { 130 for (int index = 0; index < _size; index++) {
131 _buckets[index].empty(); 131 _buckets[index].empty();
132 } 132 }
133 FREE_C_HEAP_ARRAY(KlassInfoBucket, _buckets); 133 FREE_C_HEAP_ARRAY(KlassInfoBucket, _buckets, mtInternal);
134 _size = 0; 134 _size = 0;
135 } 135 }
136 } 136 }
137 137
138 uint KlassInfoTable::hash(klassOop p) { 138 uint KlassInfoTable::hash(klassOop p) {
177 return (*e1)->compare(*e1,*e2); 177 return (*e1)->compare(*e1,*e2);
178 } 178 }
179 179
180 KlassInfoHisto::KlassInfoHisto(const char* title, int estimatedCount) : 180 KlassInfoHisto::KlassInfoHisto(const char* title, int estimatedCount) :
181 _title(title) { 181 _title(title) {
182 _elements = new (ResourceObj::C_HEAP) GrowableArray<KlassInfoEntry*>(estimatedCount,true); 182 _elements = new (ResourceObj::C_HEAP, mtInternal) GrowableArray<KlassInfoEntry*>(estimatedCount,true);
183 } 183 }
184 184
185 KlassInfoHisto::~KlassInfoHisto() { 185 KlassInfoHisto::~KlassInfoHisto() {
186 delete _elements; 186 delete _elements;
187 } 187 }