src/share/vm/runtime/java.cpp

Print this page
rev 6446 : 8040807: G1: Enable G1CollectedHeap::stop()
Reviewed-by: TBD


 483     case BEFORE_EXIT_DONE:
 484       return;
 485     }
 486   }
 487 
 488   // The only difference between this and Win32's _onexit procs is that
 489   // this version is invoked before any threads get killed.
 490   ExitProc* current = exit_procs;
 491   while (current != NULL) {
 492     ExitProc* next = current->next();
 493     current->evaluate();
 494     delete current;
 495     current = next;
 496   }
 497 
 498   // Hang forever on exit if we're reporting an error.
 499   if (ShowMessageBoxOnError && is_error_reported()) {
 500     os::infinite_sleep();
 501   }
 502 
 503   // Stop any ongoing concurrent GC work
 504   Universe::heap()->stop();
 505 
 506   // Terminate watcher thread - must before disenrolling any periodic task
 507   if (PeriodicTask::num_tasks() > 0)
 508     WatcherThread::stop();
 509 
 510   // Print statistics gathered (profiling ...)
 511   if (Arguments::has_profile()) {
 512     FlatProfiler::disengage();
 513     FlatProfiler::print(10);
 514   }
 515 
 516   // shut down the StatSampler task
 517   StatSampler::disengage();
 518   StatSampler::destroy();
 519 
 520   // We do not need to explicitly stop concurrent GC threads because the
 521   // JVM will be taken down at a safepoint when such threads are inactive --
 522   // except for some concurrent G1 threads, see (comment in)
 523   // Threads::destroy_vm().
 524 
 525   // Print GC/heap related information.
 526   if (PrintGCDetails) {
 527     Universe::print();
 528     AdaptiveSizePolicyOutput(0);
 529     if (Verbose) {
 530       ClassLoaderDataGraph::dump_on(gclog_or_tty);
 531     }
 532   }
 533 
 534   if (PrintBytecodeHistogram) {
 535     BytecodeHistogram::print();
 536   }
 537 
 538   if (JvmtiExport::should_post_thread_life()) {
 539     JvmtiExport::post_thread_end(thread);
 540   }
 541 
 542 
 543   EventThreadEnd event;




 483     case BEFORE_EXIT_DONE:
 484       return;
 485     }
 486   }
 487 
 488   // The only difference between this and Win32's _onexit procs is that
 489   // this version is invoked before any threads get killed.
 490   ExitProc* current = exit_procs;
 491   while (current != NULL) {
 492     ExitProc* next = current->next();
 493     current->evaluate();
 494     delete current;
 495     current = next;
 496   }
 497 
 498   // Hang forever on exit if we're reporting an error.
 499   if (ShowMessageBoxOnError && is_error_reported()) {
 500     os::infinite_sleep();
 501   }
 502 



 503   // Terminate watcher thread - must before disenrolling any periodic task
 504   if (PeriodicTask::num_tasks() > 0)
 505     WatcherThread::stop();
 506 
 507   // Print statistics gathered (profiling ...)
 508   if (Arguments::has_profile()) {
 509     FlatProfiler::disengage();
 510     FlatProfiler::print(10);
 511   }
 512 
 513   // shut down the StatSampler task
 514   StatSampler::disengage();
 515   StatSampler::destroy();
 516 
 517   // Stop concurrent GC threads
 518   Universe::heap()->stop();


 519 
 520   // Print GC/heap related information.
 521   if (PrintGCDetails) {
 522     Universe::print();
 523     AdaptiveSizePolicyOutput(0);
 524     if (Verbose) {
 525       ClassLoaderDataGraph::dump_on(gclog_or_tty);
 526     }
 527   }
 528 
 529   if (PrintBytecodeHistogram) {
 530     BytecodeHistogram::print();
 531   }
 532 
 533   if (JvmtiExport::should_post_thread_life()) {
 534     JvmtiExport::post_thread_end(thread);
 535   }
 536 
 537 
 538   EventThreadEnd event;