6995781: Native Memory Tracking (Phase 1)

7151532: DCmd for hotspot native memory tracking

Implementation of native memory tracking phase 1, which tracks VM native memory usage, and related DCmd

Reviewed-by: acorn, coleenp, fparain
This commit is contained in:
Zhengyu Gu 2012-06-28 17:03:16 -04:00
parent 8e42425c92
commit a39b17624a
315 changed files with 7245 additions and 1477 deletions

View file

@ -39,7 +39,7 @@
// OtherRegionsTable
class PerRegionTable: public CHeapObj {
class PerRegionTable: public CHeapObj<mtGC> {
friend class OtherRegionsTable;
friend class HeapRegionRemSetIterator;
@ -282,7 +282,7 @@ class PosParPRT: public PerRegionTable {
// We must recount the "occupied."
recount_occupied();
#endif
FREE_C_HEAP_ARRAY(PerRegionTable*, _par_tables);
FREE_C_HEAP_ARRAY(PerRegionTable*, _par_tables, mtGC);
_par_tables = NULL;
#if COUNT_PAR_EXPANDS
Atomic::inc(&n_par_contracts);
@ -385,7 +385,7 @@ public:
if (res != NULL) return;
// Otherwise, we reserved the right to do the expansion.
PerRegionTable** ptables = NEW_C_HEAP_ARRAY(PerRegionTable*, n);
PerRegionTable** ptables = NEW_C_HEAP_ARRAY(PerRegionTable*, n, mtGC);
for (int i = 0; i < n; i++) {
PerRegionTable* ptable = PerRegionTable::alloc(hr());
ptables[i] = ptable;
@ -546,9 +546,9 @@ void OtherRegionsTable::init_from_card_cache(size_t max_regions) {
_from_card_cache_max_regions = max_regions;
int n_par_rs = HeapRegionRemSet::num_par_rem_sets();
_from_card_cache = NEW_C_HEAP_ARRAY(int*, n_par_rs);
_from_card_cache = NEW_C_HEAP_ARRAY(int*, n_par_rs, mtGC);
for (int i = 0; i < n_par_rs; i++) {
_from_card_cache[i] = NEW_C_HEAP_ARRAY(int, max_regions);
_from_card_cache[i] = NEW_C_HEAP_ARRAY(int, max_regions, mtGC);
for (size_t j = 0; j < max_regions; j++) {
_from_card_cache[i][j] = -1; // An invalid value.
}
@ -1333,9 +1333,9 @@ void HeapRegionRemSet::record(HeapRegion* hr, OopOrNarrowOopStar f) {
&& _recorded_cards == NULL
&& _recorded_regions == NULL,
"Inv");
_recorded_oops = NEW_C_HEAP_ARRAY(OopOrNarrowOopStar, MaxRecorded);
_recorded_cards = NEW_C_HEAP_ARRAY(HeapWord*, MaxRecorded);
_recorded_regions = NEW_C_HEAP_ARRAY(HeapRegion*, MaxRecorded);
_recorded_oops = NEW_C_HEAP_ARRAY(OopOrNarrowOopStar, MaxRecorded, mtGC);
_recorded_cards = NEW_C_HEAP_ARRAY(HeapWord*, MaxRecorded, mtGC);
_recorded_regions = NEW_C_HEAP_ARRAY(HeapRegion*, MaxRecorded, mtGC);
}
if (_n_recorded == MaxRecorded) {
gclog_or_tty->print_cr("Filled up 'recorded' (%d).", MaxRecorded);
@ -1356,8 +1356,8 @@ void HeapRegionRemSet::record_event(Event evnt) {
assert(_n_recorded_events == 0
&& _recorded_event_index == NULL,
"Inv");
_recorded_events = NEW_C_HEAP_ARRAY(Event, MaxRecordedEvents);
_recorded_event_index = NEW_C_HEAP_ARRAY(int, MaxRecordedEvents);
_recorded_events = NEW_C_HEAP_ARRAY(Event, MaxRecordedEvents, mtGC);
_recorded_event_index = NEW_C_HEAP_ARRAY(int, MaxRecordedEvents, mtGC);
}
if (_n_recorded_events == MaxRecordedEvents) {
gclog_or_tty->print_cr("Filled up 'recorded_events' (%d).", MaxRecordedEvents);