diff -r 332416c57993 src/share/vm/gc/g1/g1PageBasedVirtualSpace.cpp --- a/src/share/vm/gc/g1/g1PageBasedVirtualSpace.cpp Fri Jul 21 21:01:59 2017 -0400 +++ b/src/share/vm/gc/g1/g1PageBasedVirtualSpace.cpp Sun Jul 23 10:26:07 2017 +0200 @@ -34,8 +34,8 @@ #include "utilities/bitMap.inline.hpp" G1PageBasedVirtualSpace::G1PageBasedVirtualSpace(ReservedSpace rs, size_t used_size, size_t page_size) : - _low_boundary(NULL), _high_boundary(NULL), _committed(), _page_size(0), _special(false), - _dirty(), _executable(false) { + _low_boundary(NULL), _high_boundary(NULL), _committed(mtGC), _page_size(0), _special(false), + _dirty(mtGC), _executable(false) { initialize_with_page_size(rs, used_size, page_size); } diff -r 332416c57993 src/share/vm/gc/g1/g1RegionToSpaceMapper.cpp --- a/src/share/vm/gc/g1/g1RegionToSpaceMapper.cpp Fri Jul 21 21:01:59 2017 -0400 +++ b/src/share/vm/gc/g1/g1RegionToSpaceMapper.cpp Sun Jul 23 10:26:07 2017 +0200 @@ -40,7 +40,7 @@ _storage(rs, used_size, page_size), _region_granularity(region_granularity), _listener(NULL), - _commit_map(rs.size() * commit_factor / region_granularity) { + _commit_map(rs.size() * commit_factor / region_granularity, mtGC) { guarantee(is_power_of_2(page_size), "must be"); guarantee(is_power_of_2(region_granularity), "must be"); diff -r 332416c57993 src/share/vm/gc/g1/heapRegionManager.hpp --- a/src/share/vm/gc/g1/heapRegionManager.hpp Fri Jul 21 21:01:59 2017 -0400 +++ b/src/share/vm/gc/g1/heapRegionManager.hpp Sun Jul 23 10:26:07 2017 +0200 @@ -130,7 +130,7 @@ // Empty constructor, we'll initialize it with the initialize() method. HeapRegionManager() : _regions(), _heap_mapper(NULL), _num_committed(0), _next_bitmap_mapper(NULL), _prev_bitmap_mapper(NULL), _bot_mapper(NULL), - _allocated_heapregions_length(0), _available_map(), + _allocated_heapregions_length(0), _available_map(mtGC), _free_list("Free list", new MasterFreeRegionListMtSafeChecker()) { } diff -r 332416c57993 src/share/vm/gc/g1/heapRegionRemSet.cpp --- a/src/share/vm/gc/g1/heapRegionRemSet.cpp Fri Jul 21 21:01:59 2017 -0400 +++ b/src/share/vm/gc/g1/heapRegionRemSet.cpp Sun Jul 23 10:26:07 2017 +0200 @@ -71,7 +71,7 @@ PerRegionTable(HeapRegion* hr) : _hr(hr), _occupied(0), - _bm(HeapRegion::CardsPerRegion), + _bm(HeapRegion::CardsPerRegion, mtGC), _collision_list_next(NULL), _next(NULL), _prev(NULL) {} @@ -261,7 +261,7 @@ OtherRegionsTable::OtherRegionsTable(HeapRegion* hr, Mutex* m) : _g1h(G1CollectedHeap::heap()), _hr(hr), _m(m), - _coarse_map(G1CollectedHeap::heap()->max_regions()), + _coarse_map(G1CollectedHeap::heap()->max_regions(), mtGC), _fine_grain_regions(NULL), _first_all_fine_prts(NULL), _last_all_fine_prts(NULL), _n_fine_entries(0), _n_coarse_entries(0), diff -r 332416c57993 src/share/vm/utilities/bitMap.cpp --- a/src/share/vm/utilities/bitMap.cpp Fri Jul 21 21:01:59 2017 -0400 +++ b/src/share/vm/utilities/bitMap.cpp Sun Jul 23 10:26:07 2017 +0200 @@ -46,9 +46,13 @@ }; class CHeapBitMapAllocator : StackObj { + private: + MEMFLAGS _flags; + public: + CHeapBitMapAllocator(MEMFLAGS flags) : _flags(flags) {} bm_word_t* allocate(size_t size_in_words) const { - return ArrayAllocator::allocate(size_in_words, mtInternal); + return ArrayAllocator::allocate(size_in_words, _flags); } void free(bm_word_t* map, idx_t size_in_words) const { ArrayAllocator::free(map, size_in_words); @@ -148,24 +152,24 @@ : BitMap(allocate(ArenaBitMapAllocator(arena), size_in_bits), size_in_bits) { } -CHeapBitMap::CHeapBitMap(idx_t size_in_bits) - : BitMap(allocate(CHeapBitMapAllocator(), size_in_bits), size_in_bits) { +CHeapBitMap::CHeapBitMap(idx_t size_in_bits, MEMFLAGS flags) + : BitMap(allocate(CHeapBitMapAllocator(flags), size_in_bits), size_in_bits), _flags(flags) { } CHeapBitMap::~CHeapBitMap() { - free(CHeapBitMapAllocator(), map(), size()); + free(CHeapBitMapAllocator(_flags), map(), size()); } void CHeapBitMap::resize(idx_t new_size_in_bits) { - BitMap::resize(CHeapBitMapAllocator(), new_size_in_bits); + BitMap::resize(CHeapBitMapAllocator(_flags), new_size_in_bits); } void CHeapBitMap::initialize(idx_t size_in_bits) { - BitMap::initialize(CHeapBitMapAllocator(), size_in_bits); + BitMap::initialize(CHeapBitMapAllocator(_flags), size_in_bits); } void CHeapBitMap::reinitialize(idx_t size_in_bits) { - BitMap::reinitialize(CHeapBitMapAllocator(), size_in_bits); + BitMap::reinitialize(CHeapBitMapAllocator(_flags), size_in_bits); } #ifdef ASSERT diff -r 332416c57993 src/share/vm/utilities/bitMap.hpp --- a/src/share/vm/utilities/bitMap.hpp Fri Jul 21 21:01:59 2017 -0400 +++ b/src/share/vm/utilities/bitMap.hpp Sun Jul 23 10:26:07 2017 +0200 @@ -353,10 +353,13 @@ CHeapBitMap(const CHeapBitMap&); CHeapBitMap& operator=(const CHeapBitMap&); + // NMT memory type + MEMFLAGS _flags; + public: - CHeapBitMap() : BitMap(NULL, 0) {} + CHeapBitMap(MEMFLAGS flags = mtInternal) : BitMap(NULL, 0), _flags(flags) {} // Clears the bitmap memory. - CHeapBitMap(idx_t size_in_bits); + CHeapBitMap(idx_t size_in_bits, MEMFLAGS flags = mtInternal); ~CHeapBitMap(); // Resize the backing bitmap memory.