8005936: PrintNMTStatistics doesn't work for normal JVM exit

Moved NMT shutdown code to JVM exit handler to ensure NMT statistics is printed when PrintNMTStatistics is enabled

Reviewed-by: acorn, dholmes, coleenp
This commit is contained in:
Zhengyu Gu 2013-01-11 12:30:54 -05:00
parent f4da82981d
commit 93d2366337
2 changed files with 4 additions and 4 deletions

View file

@ -542,6 +542,10 @@ void before_exit(JavaThread * thread) {
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