src/share/vm/runtime/java.cpp

Print this page
rev 6498 : 8044796: G1: Enable G1CollectedHeap::stop()
Reviewed-by:


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




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



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


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