comparison src/share/vm/runtime/thread.cpp @ 6741:33143ee07800

7181995: NMT ON: NMT assertion failure assert(cur_vm->is_uncommit_record() || cur_vm->is_deallocation_record Summary: Fixed virtual memory records merge and promotion logic, should be based on sequence number vs. base address order Reviewed-by: coleenp, acorn
author zgu
date Tue, 11 Sep 2012 20:53:17 -0400
parents da91efe96a93
children 6dfc6a541338
comparison
equal deleted inserted replaced
6730:5d2156bcb78b 6741:33143ee07800
316 void Thread::record_stack_base_and_size() { 316 void Thread::record_stack_base_and_size() {
317 set_stack_base(os::current_stack_base()); 317 set_stack_base(os::current_stack_base());
318 set_stack_size(os::current_stack_size()); 318 set_stack_size(os::current_stack_size());
319 319
320 // record thread's native stack, stack grows downward 320 // record thread's native stack, stack grows downward
321 address vm_base = _stack_base - _stack_size; 321 address low_stack_addr = stack_base() - stack_size();
322 MemTracker::record_virtual_memory_reserve(vm_base, _stack_size, 322 MemTracker::record_thread_stack(low_stack_addr, stack_size(), this,
323 CURRENT_PC, this); 323 CURRENT_PC);
324 MemTracker::record_virtual_memory_type(vm_base, mtThreadStack);
325 } 324 }
326 325
327 326
328 Thread::~Thread() { 327 Thread::~Thread() {
329 // Reclaim the objectmonitors from the omFreeList of the moribund thread. 328 // Reclaim the objectmonitors from the omFreeList of the moribund thread.
330 ObjectSynchronizer::omFlush (this) ; 329 ObjectSynchronizer::omFlush (this) ;
331 330
332 MemTracker::record_virtual_memory_release((_stack_base - _stack_size), 331 address low_stack_addr = stack_base() - stack_size();
333 _stack_size, this); 332 MemTracker::release_thread_stack(low_stack_addr, stack_size(), this);
334 333
335 // deallocate data structures 334 // deallocate data structures
336 delete resource_area(); 335 delete resource_area();
337 // since the handle marks are using the handle area, we have to deallocated the root 336 // since the handle marks are using the handle area, we have to deallocated the root
338 // handle mark before deallocating the thread's handle area, 337 // handle mark before deallocating the thread's handle area,