src/share/vm/runtime/java.cpp

Print this page


   1 /*
   2  * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 405     switch (_before_exit_status) {
 406     case BEFORE_EXIT_NOT_RUN:
 407       _before_exit_status = BEFORE_EXIT_RUNNING;
 408       break;
 409     case BEFORE_EXIT_RUNNING:
 410       while (_before_exit_status == BEFORE_EXIT_RUNNING) {
 411         BeforeExit_lock->wait();
 412       }
 413       assert(_before_exit_status == BEFORE_EXIT_DONE, "invalid state");
 414       return;
 415     case BEFORE_EXIT_DONE:
 416       return;
 417     }
 418   }
 419 
 420   // Hang forever on exit if we're reporting an error.
 421   if (ShowMessageBoxOnError && is_error_reported()) {
 422     os::infinite_sleep();
 423   }
 424 
 425   // Terminate watcher thread - must before disenrolling any periodic task
 426   if (PeriodicTask::num_tasks() > 0)

 427     WatcherThread::stop();

 428 
 429   // Print statistics gathered (profiling ...)
 430   if (Arguments::has_profile()) {
 431     FlatProfiler::disengage();
 432     FlatProfiler::print(10);
 433   }
 434 
 435   // shut down the StatSampler task
 436   StatSampler::disengage();
 437   StatSampler::destroy();
 438 
 439   // Stop concurrent GC threads
 440   Universe::heap()->stop();
 441 
 442   // Print GC/heap related information.
 443   if (PrintGCDetails) {
 444     Universe::print();
 445     AdaptiveSizePolicyOutput(0);
 446     if (Verbose) {
 447       ClassLoaderDataGraph::dump_on(gclog_or_tty);


   1 /*
   2  * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 405     switch (_before_exit_status) {
 406     case BEFORE_EXIT_NOT_RUN:
 407       _before_exit_status = BEFORE_EXIT_RUNNING;
 408       break;
 409     case BEFORE_EXIT_RUNNING:
 410       while (_before_exit_status == BEFORE_EXIT_RUNNING) {
 411         BeforeExit_lock->wait();
 412       }
 413       assert(_before_exit_status == BEFORE_EXIT_DONE, "invalid state");
 414       return;
 415     case BEFORE_EXIT_DONE:
 416       return;
 417     }
 418   }
 419 
 420   // Hang forever on exit if we're reporting an error.
 421   if (ShowMessageBoxOnError && is_error_reported()) {
 422     os::infinite_sleep();
 423   }
 424 
 425   // Stop the WatcherThread. We do this before disenrolling various
 426   // PeriodicTasks to reduce the likelihood of races.
 427   if (PeriodicTask::num_tasks() > 0) {
 428     WatcherThread::stop();
 429   }
 430 
 431   // Print statistics gathered (profiling ...)
 432   if (Arguments::has_profile()) {
 433     FlatProfiler::disengage();
 434     FlatProfiler::print(10);
 435   }
 436 
 437   // shut down the StatSampler task
 438   StatSampler::disengage();
 439   StatSampler::destroy();
 440 
 441   // Stop concurrent GC threads
 442   Universe::heap()->stop();
 443 
 444   // Print GC/heap related information.
 445   if (PrintGCDetails) {
 446     Universe::print();
 447     AdaptiveSizePolicyOutput(0);
 448     if (Verbose) {
 449       ClassLoaderDataGraph::dump_on(gclog_or_tty);