changeset 4417:c28e0cb8d005

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, coleenp
author zgu
date Fri, 11 Jan 2013 12:30:54 -0500
parents 62eafb1b8499
children 24aa4f99d1aa 21fe158e804b
files src/share/vm/runtime/java.cpp src/share/vm/runtime/thread.cpp
diffstat 2 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/runtime/java.cpp	Wed Jan 09 14:46:55 2013 -0500
+++ b/src/share/vm/runtime/java.cpp	Fri Jan 11 12:30:54 2013 -0500
@@ -549,6 +549,10 @@
     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_RUNNING
   #undef BEFORE_EXIT_DONE
--- a/src/share/vm/runtime/thread.cpp	Wed Jan 09 14:46:55 2013 -0500
+++ b/src/share/vm/runtime/thread.cpp	Fri Jan 11 12:30:54 2013 -0500
@@ -3955,10 +3955,6 @@
                          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.
   if (ShowMessageBoxOnError && is_error_reported()) {
     os::infinite_sleep();