Mercurial > hg > graal-compiler
comparison src/share/vm/gc_implementation/shared/mutableNUMASpace.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 | b632e80fc9dc |
children | f34d701e952e |
comparison
equal
deleted
inserted
replaced
6174:74533f63b116 | 6197:d2a62e0f25eb |
---|---|
41 # include "thread_bsd.inline.hpp" | 41 # include "thread_bsd.inline.hpp" |
42 #endif | 42 #endif |
43 | 43 |
44 | 44 |
45 MutableNUMASpace::MutableNUMASpace(size_t alignment) : MutableSpace(alignment) { | 45 MutableNUMASpace::MutableNUMASpace(size_t alignment) : MutableSpace(alignment) { |
46 _lgrp_spaces = new (ResourceObj::C_HEAP) GrowableArray<LGRPSpace*>(0, true); | 46 _lgrp_spaces = new (ResourceObj::C_HEAP, mtGC) GrowableArray<LGRPSpace*>(0, true); |
47 _page_size = os::vm_page_size(); | 47 _page_size = os::vm_page_size(); |
48 _adaptation_cycles = 0; | 48 _adaptation_cycles = 0; |
49 _samples_count = 0; | 49 _samples_count = 0; |
50 update_layout(true); | 50 update_layout(true); |
51 } | 51 } |
229 // Check if the topology had changed. | 229 // Check if the topology had changed. |
230 bool changed = os::numa_topology_changed(); | 230 bool changed = os::numa_topology_changed(); |
231 if (force || changed) { | 231 if (force || changed) { |
232 // Compute lgrp intersection. Add/remove spaces. | 232 // Compute lgrp intersection. Add/remove spaces. |
233 int lgrp_limit = (int)os::numa_get_groups_num(); | 233 int lgrp_limit = (int)os::numa_get_groups_num(); |
234 int *lgrp_ids = NEW_C_HEAP_ARRAY(int, lgrp_limit); | 234 int *lgrp_ids = NEW_C_HEAP_ARRAY(int, lgrp_limit, mtGC); |
235 int lgrp_num = (int)os::numa_get_leaf_groups(lgrp_ids, lgrp_limit); | 235 int lgrp_num = (int)os::numa_get_leaf_groups(lgrp_ids, lgrp_limit); |
236 assert(lgrp_num > 0, "There should be at least one locality group"); | 236 assert(lgrp_num > 0, "There should be at least one locality group"); |
237 // Add new spaces for the new nodes | 237 // Add new spaces for the new nodes |
238 for (int i = 0; i < lgrp_num; i++) { | 238 for (int i = 0; i < lgrp_num; i++) { |
239 bool found = false; | 239 bool found = false; |
263 } else { | 263 } else { |
264 i++; | 264 i++; |
265 } | 265 } |
266 } | 266 } |
267 | 267 |
268 FREE_C_HEAP_ARRAY(int, lgrp_ids); | 268 FREE_C_HEAP_ARRAY(int, lgrp_ids, mtGC); |
269 | 269 |
270 if (changed) { | 270 if (changed) { |
271 for (JavaThread *thread = Threads::first(); thread; thread = thread->next()) { | 271 for (JavaThread *thread = Threads::first(); thread; thread = thread->next()) { |
272 thread->set_lgrp_id(-1); | 272 thread->set_lgrp_id(-1); |
273 } | 273 } |