Mercurial > hg > graal-compiler
comparison src/share/vm/services/memTrackWorker.cpp @ 6599:4acebbe310e1
7185614: NMT ON: "check by caller" assertion failed on nsk ThreadMXBean test
7187429: NMT ON: Merge failure should cause NMT to shutdown
Summary: Fixed NMT assertion failures
Reviewed-by: acorn, kvn
author | zgu |
---|---|
date | Wed, 01 Aug 2012 17:19:30 -0400 |
parents | d2a62e0f25eb |
children | 33143ee07800 |
comparison
equal
deleted
inserted
replaced
6242:fe94b4e7212b | 6599:4acebbe310e1 |
---|---|
97 assert(count_recorder(_gen[_head]) <= MemRecorder::_instance_count, | 97 assert(count_recorder(_gen[_head]) <= MemRecorder::_instance_count, |
98 "infinite loop after dequeue"); | 98 "infinite loop after dequeue"); |
99 } | 99 } |
100 if (rec != NULL) { | 100 if (rec != NULL) { |
101 // merge the recorder into staging area | 101 // merge the recorder into staging area |
102 bool result = snapshot->merge(rec); | 102 if (!snapshot->merge(rec)) { |
103 assert(result, "merge failed"); | 103 MemTracker::shutdown(MemTracker::NMT_out_of_memory); |
104 debug_only(_merge_count ++;) | 104 } else { |
105 NOT_PRODUCT(_merge_count ++;) | |
106 } | |
105 MemTracker::release_thread_recorder(rec); | 107 MemTracker::release_thread_recorder(rec); |
106 } else { | 108 } else { |
107 // no more recorder to merge, promote staging area | 109 // no more recorder to merge, promote staging area |
108 // to snapshot | 110 // to snapshot |
109 if (_head != _tail) { | 111 if (_head != _tail) { |
127 } | 129 } |
128 } | 130 } |
129 } | 131 } |
130 assert(MemTracker::shutdown_in_progress(), "just check"); | 132 assert(MemTracker::shutdown_in_progress(), "just check"); |
131 | 133 |
132 // transites to final shutdown | 134 // transits to final shutdown |
133 MemTracker::final_shutdown(); | 135 MemTracker::final_shutdown(); |
134 } | 136 } |
135 | 137 |
136 // at synchronization point, where 'safepoint visible' Java threads are blocked | 138 // at synchronization point, where 'safepoint visible' Java threads are blocked |
137 // at a safepoint, and the rest of threads are blocked on ThreadCritical lock. | 139 // at a safepoint, and the rest of threads are blocked on ThreadCritical lock. |