comparison src/share/vm/services/memTracker.cpp @ 20363:36c9011aaead

8054368: nsk/jdi/VirtualMachine/exit/exit002 crash with detail tracking on (NMT2) Summary: Dynamic allocate _reserved_regions instead of static object to avoid racing during process exit Reviewed-by: dholmes, coleenp
author zgu
date Thu, 14 Aug 2014 09:02:51 -0400
parents 833b0f92429a
children c6211b707068
comparison
equal deleted inserted replaced
20362:f433f37645e5 20363:36c9011aaead
75 } 75 }
76 return level; 76 return level;
77 } 77 }
78 78
79 void MemTracker::init() { 79 void MemTracker::init() {
80 if (tracking_level() >= NMT_summary) { 80 NMT_TrackingLevel level = tracking_level();
81 if (level >= NMT_summary) {
82 if (!VirtualMemoryTracker::late_initialize(level)) {
83 shutdown();
84 return;
85 }
81 _query_lock = new (std::nothrow) Mutex(Monitor::max_nonleaf, "NMT_queryLock"); 86 _query_lock = new (std::nothrow) Mutex(Monitor::max_nonleaf, "NMT_queryLock");
82 // Already OOM. It is unlikely, but still have to handle it. 87 // Already OOM. It is unlikely, but still have to handle it.
83 if (_query_lock == NULL) { 88 if (_query_lock == NULL) {
84 shutdown(); 89 shutdown();
85 } 90 }