55 #include "runtime/sweeper.hpp" |
55 #include "runtime/sweeper.hpp" |
56 #include "runtime/task.hpp" |
56 #include "runtime/task.hpp" |
57 #include "runtime/thread.inline.hpp" |
57 #include "runtime/thread.inline.hpp" |
58 #include "runtime/timer.hpp" |
58 #include "runtime/timer.hpp" |
59 #include "runtime/vm_operations.hpp" |
59 #include "runtime/vm_operations.hpp" |
60 #include "services/memReporter.hpp" |
|
61 #include "services/memTracker.hpp" |
60 #include "services/memTracker.hpp" |
62 #include "trace/tracing.hpp" |
61 #include "trace/tracing.hpp" |
63 #include "utilities/dtrace.hpp" |
62 #include "utilities/dtrace.hpp" |
64 #include "utilities/globalDefinitions.hpp" |
63 #include "utilities/globalDefinitions.hpp" |
65 #include "utilities/histogram.hpp" |
64 #include "utilities/histogram.hpp" |
362 } |
361 } |
363 #endif // COMPILER2 |
362 #endif // COMPILER2 |
364 #endif // ENABLE_ZAP_DEAD_LOCALS |
363 #endif // ENABLE_ZAP_DEAD_LOCALS |
365 // Native memory tracking data |
364 // Native memory tracking data |
366 if (PrintNMTStatistics) { |
365 if (PrintNMTStatistics) { |
367 if (MemTracker::is_on()) { |
366 MemTracker::final_report(tty); |
368 BaselineTTYOutputer outputer(tty); |
|
369 MemTracker::print_memory_usage(outputer, K, false); |
|
370 } else { |
|
371 tty->print_cr("%s", MemTracker::reason()); |
|
372 } |
|
373 } |
367 } |
374 } |
368 } |
375 |
369 |
376 #else // PRODUCT MODE STATISTICS |
370 #else // PRODUCT MODE STATISTICS |
377 |
371 |
399 BiasedLocking::print_counters(); |
393 BiasedLocking::print_counters(); |
400 } |
394 } |
401 |
395 |
402 // Native memory tracking data |
396 // Native memory tracking data |
403 if (PrintNMTStatistics) { |
397 if (PrintNMTStatistics) { |
404 if (MemTracker::is_on()) { |
398 MemTracker::final_report(tty); |
405 BaselineTTYOutputer outputer(tty); |
|
406 MemTracker::print_memory_usage(outputer, K, false); |
|
407 } else { |
|
408 tty->print_cr("%s", MemTracker::reason()); |
|
409 } |
|
410 } |
399 } |
411 } |
400 } |
412 |
401 |
413 #endif |
402 #endif |
414 |
403 |
553 { MutexLocker ml(BeforeExit_lock); |
542 { MutexLocker ml(BeforeExit_lock); |
554 _before_exit_status = BEFORE_EXIT_DONE; |
543 _before_exit_status = BEFORE_EXIT_DONE; |
555 BeforeExit_lock->notify_all(); |
544 BeforeExit_lock->notify_all(); |
556 } |
545 } |
557 |
546 |
558 // Shutdown NMT before exit. Otherwise, |
|
559 // it will run into trouble when system destroys static variables. |
|
560 MemTracker::shutdown(MemTracker::NMT_normal); |
|
561 |
|
562 if (VerifyStringTableAtExit) { |
547 if (VerifyStringTableAtExit) { |
563 int fail_cnt = 0; |
548 int fail_cnt = 0; |
564 { |
549 { |
565 MutexLocker ml(StringTable_lock); |
550 MutexLocker ml(StringTable_lock); |
566 fail_cnt = StringTable::verify_and_compare_entries(); |
551 fail_cnt = StringTable::verify_and_compare_entries(); |