Mercurial > hg > truffle
diff 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 |
line wrap: on
line diff
--- a/src/share/vm/services/memTracker.cpp Tue Aug 12 12:39:02 2014 -0700 +++ b/src/share/vm/services/memTracker.cpp Thu Aug 14 09:02:51 2014 -0400 @@ -77,7 +77,12 @@ } void MemTracker::init() { - if (tracking_level() >= NMT_summary) { + NMT_TrackingLevel level = tracking_level(); + if (level >= NMT_summary) { + if (!VirtualMemoryTracker::late_initialize(level)) { + shutdown(); + return; + } _query_lock = new (std::nothrow) Mutex(Monitor::max_nonleaf, "NMT_queryLock"); // Already OOM. It is unlikely, but still have to handle it. if (_query_lock == NULL) {