Up Top

Serviceability 機能 : スレッドダンプ機能(thread dump)


Under Construction

概要(Summary)

(#Under Construction) (See: here for details)

スレッドダンプ機能は signal_thread_entry() 関数内に実装されている.

    ((cite: hotspot/src/share/vm/runtime/os.cpp))
    static void signal_thread_entry(JavaThread* thread, TRAPS) {
    ...
      while (true) {
    ...
        switch (sig) {
          case SIGBREAK: {
            // Check if the signal is a trigger to start the Attach Listener - in that
            // case don't print stack traces.
            if (!DisableAttachMechanism && AttachListener::is_init_trigger()) {
              continue;
            }
            // Print stack traces
            // Any SIGBREAK operations added here should make sure to flush
            // the output stream (e.g. tty->flush()) after output.  See 4803766.
            // Each module also prints an extra carriage return after its output.
            VM_PrintThreads op;
            VMThread::execute(&op);
            VM_PrintJNI jni_op;
            VMThread::execute(&jni_op);
            VM_FindDeadlocks op1(tty);
            VMThread::execute(&op1);
            Universe::print_heap_at_SIGBREAK();
            if (PrintClassHistogram) {
              VM_GC_HeapInspection op1(gclog_or_tty, true /* force full GC before heap inspection */,
                                       true /* need_prologue */);
              VMThread::execute(&op1);
            }
            if (JvmtiExport::should_post_data_dump()) {
              JvmtiExport::post_data_dump();
            }
            break;
          }
    ...

備考(Notes)

なお, SIGBREAK が定義されていないプラットフォームでは SIGQUIT を用いる.

    ((cite: hotspot/src/share/vm/runtime/os.cpp))
    // SIGBREAK is sent by the keyboard to query the VM state
    #ifndef SIGBREAK
    #define SIGBREAK SIGQUIT
    #endif

処理の流れ (概要)(Execution Flows : Summary)

(See: here for details)
-> signal_thread_entry()
   -> VMThread::execute()
      -> (See: here for details)
         -> VM_PrintThreads::doit_prologue()
         -> VM_PrintThreads::doit()
         -> VM_PrintThreads::doit_epilogue()
   -> VMThread::execute()
      -> (See: here for details)
         -> VM_PrintJNI::doit()
   -> VMThread::execute()
      -> (See: here for details)
         -> VM_FindDeadlocks::doit_prologue()
         -> VM_FindDeadlocks::doit()
   -> Universe::print_heap_at_SIGBREAK()
   -> VMThread::execute()
      -> (See: here for details)
         -> VM_GC_HeapInspection::doit_prologue()
         -> VM_GC_HeapInspection::doit()
   -> JvmtiExport::post_data_dump()
      -> (See: here for details)

処理の流れ (詳細)(Execution Flows : Details)

VM_PrintThreads::doit()

See: here for details

VM_PrintJNI::doit()

See: here for details

VM_FindDeadlocks::doit()

(#Under Construction)

Universe::print_heap_at_SIGBREAK()

(#Under Construction)

VM_GC_HeapInspection::doit()

See: here for details


This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.