diff src/share/vm/gc_implementation/g1/heapRegionRemSet.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 5c8bd7c16119
children 24b9c7f4cae6
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp	Wed Jun 27 15:23:36 2012 +0200
+++ b/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp	Thu Jun 28 17:03:16 2012 -0400
@@ -39,7 +39,7 @@
 
 // OtherRegionsTable
 
-class PerRegionTable: public CHeapObj {
+class PerRegionTable: public CHeapObj<mtGC> {
   friend class OtherRegionsTable;
   friend class HeapRegionRemSetIterator;
 
@@ -282,7 +282,7 @@
     // 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 @@
       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 @@
   _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 @@
            && _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 @@
     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);