src/share/vm/services/memTracker.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File hotspot Cdiff src/share/vm/services/memTracker.cpp

src/share/vm/services/memTracker.cpp

Print this page

        

*** 359,368 **** --- 359,372 ---- #endif // for a JavaThread, if it is running in native state, we need to transition it to // VM state, so it can stop at safepoint. JavaThread running in VM state does not // need lock to write records. if (thread->is_Java_thread() && ((JavaThread*)thread)->is_safepoint_visible()) { + assert(!(SafepointSynchronize::is_at_safepoint() && + ((JavaThread*)thread)->thread_state() == _thread_blocked), + "_thread_blocked allocate/deallocation memory at safepoint"); + if (((JavaThread*)thread)->thread_state() == _thread_in_native) { ThreadInVMfromNative trans((JavaThread*)thread); create_record_in_recorder(addr, flags, size, pc, thread); } else { create_record_in_recorder(addr, flags, size, pc, thread);
*** 484,495 **** } } // now, it is the time to shut whole things off if (_state == NMT_final_shutdown) { - _tracking_level = NMT_off; - // walk all JavaThreads to delete all recorders SyncThreadRecorderClosure stc; Threads::threads_do(&stc); // delete global recorder { --- 488,497 ----
*** 497,509 **** if (_global_recorder != NULL) { delete _global_recorder; _global_recorder = NULL; } } ! _state = NMT_shutdown; } } /* * Start worker thread. */ --- 499,519 ---- if (_global_recorder != NULL) { delete _global_recorder; _global_recorder = NULL; } } ! MemRecorder* pending_recorders = get_pending_recorders(); ! if (pending_recorders != NULL) { ! delete pending_recorders; ! } ! // wait until MemRecorder instance drops to zero to ! // completely shutdown NMT ! if (MemRecorder::_instance_count == 0) { _state = NMT_shutdown; + _tracking_level = NMT_off; } + } } /* * Start worker thread. */
src/share/vm/services/memTracker.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File