comparison src/share/vm/gc_implementation/g1/sparsePRT.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 720b6a76dd9d
children 5c93c1f61226
comparison
equal deleted inserted replaced
6174:74533f63b116 6197:d2a62e0f25eb
146 // ---------------------------------------------------------------------- 146 // ----------------------------------------------------------------------
147 147
148 RSHashTable::RSHashTable(size_t capacity) : 148 RSHashTable::RSHashTable(size_t capacity) :
149 _capacity(capacity), _capacity_mask(capacity-1), 149 _capacity(capacity), _capacity_mask(capacity-1),
150 _occupied_entries(0), _occupied_cards(0), 150 _occupied_entries(0), _occupied_cards(0),
151 _entries((SparsePRTEntry*)NEW_C_HEAP_ARRAY(char, SparsePRTEntry::size() * capacity)), 151 _entries((SparsePRTEntry*)NEW_C_HEAP_ARRAY(char, SparsePRTEntry::size() * capacity, mtGC)),
152 _buckets(NEW_C_HEAP_ARRAY(int, capacity)), 152 _buckets(NEW_C_HEAP_ARRAY(int, capacity, mtGC)),
153 _free_list(NullEntry), _free_region(0) 153 _free_list(NullEntry), _free_region(0)
154 { 154 {
155 clear(); 155 clear();
156 } 156 }
157 157
158 RSHashTable::~RSHashTable() { 158 RSHashTable::~RSHashTable() {
159 if (_entries != NULL) { 159 if (_entries != NULL) {
160 FREE_C_HEAP_ARRAY(SparsePRTEntry, _entries); 160 FREE_C_HEAP_ARRAY(SparsePRTEntry, _entries, mtGC);
161 _entries = NULL; 161 _entries = NULL;
162 } 162 }
163 if (_buckets != NULL) { 163 if (_buckets != NULL) {
164 FREE_C_HEAP_ARRAY(int, _buckets); 164 FREE_C_HEAP_ARRAY(int, _buckets, mtGC);
165 _buckets = NULL; 165 _buckets = NULL;
166 } 166 }
167 } 167 }
168 168
169 void RSHashTable::clear() { 169 void RSHashTable::clear() {