提交 46be0cea 编写于 作者: Z zgu

8005936: PrintNMTStatistics doesn't work for normal JVM exit

Summary: Moved NMT shutdown code to JVM exit handler to ensure NMT statistics is printed when PrintNMTStatistics is enabled
Reviewed-by: acorn, dholmes, coleenp
上级 8482aaa3
...@@ -542,6 +542,10 @@ void before_exit(JavaThread * thread) { ...@@ -542,6 +542,10 @@ void before_exit(JavaThread * thread) {
BeforeExit_lock->notify_all(); BeforeExit_lock->notify_all();
} }
// Shutdown NMT before exit. Otherwise,
// it will run into trouble when system destroys static variables.
MemTracker::shutdown(MemTracker::NMT_normal);
#undef BEFORE_EXIT_NOT_RUN #undef BEFORE_EXIT_NOT_RUN
#undef BEFORE_EXIT_RUNNING #undef BEFORE_EXIT_RUNNING
#undef BEFORE_EXIT_DONE #undef BEFORE_EXIT_DONE
......
...@@ -4011,10 +4011,6 @@ bool Threads::destroy_vm() { ...@@ -4011,10 +4011,6 @@ bool Threads::destroy_vm() {
Mutex::_as_suspend_equivalent_flag); Mutex::_as_suspend_equivalent_flag);
} }
// Shutdown NMT before exit. Otherwise,
// it will run into trouble when system destroys static variables.
MemTracker::shutdown(MemTracker::NMT_normal);
// Hang forever on exit if we are reporting an error. // Hang forever on exit if we are reporting an error.
if (ShowMessageBoxOnError && is_error_reported()) { if (ShowMessageBoxOnError && is_error_reported()) {
os::infinite_sleep(); os::infinite_sleep();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册