JNI - getting a thread dump

Hi !
I'm using JNI to create a JVM inside of my C daemon, and it's working OK except that the JVM is hanging sometimes (rarely), and I would like to get the thread dump, like when you send SIGQUIT to the java process. But it doesn't work with my program. Why?
Thanks
- Rustam -

Do you have any signal handlers installed in your native code? If so, you may have to remove them - they can interfere with the JVM's use of signals, prior to Java 1.4.
Java 1.4 introduces a "signal chaining" facility whereby you may use your own signal handlers in native code that will be chained after the JVM's own signal handlers are called. This version of JVM includes a library for determining whether a signal is intended for the JVM or for native code in the same process.

Similar Messages

  • How to get a thread dump, in case of an IDE freeze

    When you're working with the IDE and if it either freezes or becomes sluggish for no apparent reason, it's recommended to generate a thread dump, and report it to Studio feedback alias ([email protected]) with a description of what happened and attach the dump to it.
    A thread dump is an invaluable source of information to IDE developers when investigating deadlocks and some performance issues. It is a textual dump of all active threads and monitors of Java apps running in a Virtual Machine.
    The ways to generate a thread dump differ depending on the platform:
    * Windows systems
    Press Ctrl-Break in the command console you used to start the IDE.
    You won't be able to see the console in case you started the IDE using the default desktop icon created by the IDE installer. To be able to generate the thread dump, you must launch the IDE using a console window (invoke Command Prompt, go to {studio-install-dir}/bin and type runide.exe), or configure the desktop shortcut properties to launch the runide.exe program instead of the default runidew.exe.
    Note: You should increase the screen buffer size of the command prompt, so that it could retian the entire thread dump output. To do that, on the command prompt where IDE is running, open the properties dialog box by right clicking on the titlebar and selecting 'properties'. Then select the 'layout tab' and increase the 'screen buffer size' parameters to - width - 200, Height - 4000.
    * Unix systems
    Press Ctrl-\ in the terminal console you used to start the JSE.
    Alternatively, you can also generate a thread dump by sending the QUIT signal to the Java VM running the JSE
    kill -QUIT process_id
    where process_id is the process number of the respective java process.
    -------Here is a sample thread dump -------
    Full thread dump Java HotSpot(TM) Client VM (1.4.2_01-b06 mixed mode):
    "Text-Layout" daemon prio=2 tid=0x0886ebd8 nid=0x4e4 in Object.wait() [9e8f000..9e8fd94]
    at java.lang.Object.wait(Native Method)
    - waiting on <0x11730910> (a org.netbeans.editor.view.spi.ViewLayoutQueue)
    at java.lang.Object.wait(Object.java:429)
    at org.netbeans.editor.view.spi.ViewLayoutQueue.waitForTask(ViewLayoutQueue.java:128)
    - locked <0x11730910> (a org.netbeans.editor.view.spi.ViewLayoutQueue)
    at org.netbeans.editor.view.spi.ViewLayoutQueue$LayoutThread.run(ViewLayoutQueue.java:182)
    "Compilation" daemon prio=2 tid=0x0883d878 nid=0xb1c in Object.wait() [9c8f000..9c8fd94]
    at java.lang.Object.wait(Native Method)
    - waiting on <0x1143dde0> (a java.util.LinkedList)
    at java.lang.Object.wait(Object.java:429)
    at org.netbeans.core.compiler.CompilationEngineImpl$CompilerThread.nextJobAndTask(CompilationEngineImpl.java:162)
    - locked <0x1143dde0> (a java.util.LinkedList)
    at org.netbeans.core.compiler.CompilationEngineImpl$CompilerThread.run(CompilationEngineImpl.java:175)
    "TimerQueue" daemon prio=5 tid=0x03575478 nid=0xb18 in Object.wait() [988f000..988fd94]
    at java.lang.Object.wait(Native Method)
    - waiting on <0x10d4af60> (a javax.swing.TimerQueue)
    at javax.swing.TimerQueue.run(TimerQueue.java:231)
    - locked <0x10d4af60> (a javax.swing.TimerQueue)
    at java.lang.Thread.run(Thread.java:534)
    "AWT-EventQueue-1" prio=7 tid=0x0344fae0 nid=0xb14 in Object.wait() [3caf000..3cafd94]
    at java.lang.Object.wait(Native Method)
    - waiting on <0x10d4afe8> (a java.awt.EventQueue)
    at java.lang.Object.wait(Object.java:429)
    at java.awt.EventQueue.getNextEvent(EventQueue.java:339)
    - locked <0x10d4afe8> (a java.awt.EventQueue)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:162)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

    You can get a thread dump (Windows only) whitout any preparation. Simply use the Stack Trace tool from this web site:
    http://tmitevski.users.mcs2.netarray.com
    It works on Windows services too.

  • Getting a thread dump

    Is there a way from within a java program to get a thread dump of the jvm? I want to write some code that watched for a certain condition, then immediatly halts the jvm and dumps all the thread state.
    Thanks for your ideas...

    Thanks, but... those methods are useful for getting a status of the current thread, or of other threads in your thread group, but that is not I'm after.
    What I need is similar to the effect of sending a SIGQUIT signal to the JVM, causing it to stop and dump all the thread state. I want to trigger that from code running in the JVM.
    Basically I am trying to track down a bug in a complex server application, where on a dual processor box (only!), the current time zone gets reset to GMT at some point. It happens at some non-deterministic point in the application's lifetime. The app is multithreaded. I was going to just write a watchdog thread that continually monitored the timezone, then when the timezone changed the watchdog would dump all thread states. After doing this a few times I was hoping to see a pattern in where the various threads were executing. Needless to say, I have examined all the code, and nothing is setting the timezone explicitly.

  • How to get a thread dump from Weblogic 9.1

    Hi All,
    Can someone please walk me through how to configure a WLS9.1 server to generate thread dumps. Ideally I'd like to do this via the admin console. I read about the MagicThreadDumpFile property, but can't see where/how to set it.
    Many Thanks
    Stuart

    I only know how to do this in WLS 8.1, but it will likely work in 9.1. On UNIX, you can send a kill -QUIT to the pid and it will dump threads to standard output for the server. You can also use weblogic.Admin THREAD_DUMP (http://e-docs.bea.com/wls/docs92/admin_ref/cli.html#wp1197887) or whatever is the equivalent in WLST now that weblogic.Admin is deprecated in 9.x. I'm guessing it is the threadDump() method documented at http://e-docs.bea.com/wls/docs92/config_scripting/reference.html#wp1104314.
    I know of no way to do this through the console, unfortunately.

  • How to get a Thread Dump from Windows Service?

    We're running WLS 8.1 as a Windows Service, but we can't seem to generate a Thread Dump when the server locks up (apparently).
    Can anybody recommend a wrapper that will do this?
    --Kurt                                                                                                                                                                                                                                                                                                                                                                                           

    Hi,
    Please refer to the following URL for more information http://e-docs.bea.com/wls/docs81/adminguide/winservice.html
    To cause the WebLogic Server instance to print a thread dump to standard out, do either of the following:
    Use the weblogic.Admin THREAD_DUMP command. For more information, refer to "THREAD_DUMP" in the WebLogic Server Command Reference.
    Open a command prompt and enter the following command:
    WL_HOME\bin\beasvc -dump -svcname:service-name
    where WL_HOME is the directory in which you installed WebLogic Server and
    service-name is the Windows service that is running a server instance.
    For example:
    D:\bea\weblogic81\server\bin\beasvc -dump -svcname:mydomain_myserver
    Cheers
    Raj

  • Getting thread dump of JWS application

    Hi,
    I know this was discussed a few times before, but I still have no solution for my problem.
    I have a JWS GUI application that deadlocks sometimes (Windows 98). So I want to get the thread dump to analyze the deadlock. In Java Web Start I changed the java command from javaw.exe to java.exe, so I get a dos box. When I press CTRL-BREAK inside the dos box, I get the thread dump but because the dos box just shows a few lines I only get the last lines of the dump. Under Windows 98 I cannot resize the dos box.
    Is there a way to redirect the output of the dos box to a file? Or is there another way to get the thread dump of a JWS application?
    Thanks in advance
    Markus

    Here is 50% of the solution. To generate a thread dump programatically, you need to call JVM_DumpAllStacks through JNI. You need to link in "jvm.lib".
    JNIEXPORT void JNICALL JVM_DumpAllStacks(JNIEnv *env, jclass unused);
    JNIEXPORT void JNICALL Java_Services_generateThreadDump(JNIEnv *env, jobject thisObject) {
         // Produce a thread dump to VM standard out
         JVM_DumpAllStacks( env, NULL );
    }Here is the java class that calls the JVM_DumpAllStacks method through JNI.
    public class Services {
          * Send a message to the VM, forcing it to create a thread dump. The resulting
          * thread dump will be sent to stdout. Note that this is the VM's stdout, not
          * necessarily System.out.
         public static native void generateThreadDump();
    }When you reach the point in your code that you want to generate a thread dump, close stdout and reopen it with the thread dump destination stream. Next, call the JNI method. This will send the thread dump to stdout.
         // Replace stdout with a file output stream
         System.out.close();
         System.setOut( new PrintStream( new FileOutputStream( "stdout.log" )));
         // Generate thread dump
         Services.generateThreadDump();Why is this only 50% of the solution ? Because this works beautifully for regular applications but it does NOT work for WebStart applications. Not sure what is happening here, but so far I have not managed to get any thread dump in a file from an application that has been fired up through WebStart. Note that I CAN get a thread dump in a file if I fire up the same code from the command line.

  • Getting Thread Dump programitically ?

    Hi,
    Is there any way by which we can get the thread dump programatically?
    We are using Solaris OS and when we tried to get the thread dump using
    'kill -QUIT <pid of process>' the process(WebLogic) got crashed.
    So, please let me know how can we get the thread dump programatically.
    regards,
    Raghu

    There is a new static method for Thread called getAllStackTraces(). It is new for 1.5. See http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Thread.html#getAllStackTraces()You can start with that.

  • Thread dump running Classic JVM(jdk 1.2.2)

    Hi,
    We get a thread dump while running our application. The application is in java/jsp running on apache-tomcat. The tomcat version is 3.2.1. Java version being used is:
    java version "1.2.2"
    Classic VM (build JDK-1.2.2-007, native threads, symcjit)
    Does anyone have any idea how to identify the reason for the thread dump? The application eventually hangs after the thread dump. Thanks in advance. Below is the dump:
    <pre>
    Full thread dump Classic VM (JDK-1.2.2_007, native threads):
    "Thread-34" (TID:0x5faa550, sys_thread_t:0x2f4158, state:CW, native ID:0xb9c) prio=5
    "Thread-33" (TID:0x5faa1d0, sys_thread_t:0x22092f98, state:CW, native ID:0xa54) prio=5
         at java.lang.Object.wait(Native Method)
         at org.apache.tomcat.util.ThreadPool$MonitorRunnable.run(ThreadPool.java, Compiled Code)
         at java.lang.Thread.run(Thread.java:479)
    "Thread-32" (TID:0x5faa220, sys_thread_t:0x2207df88, state:R, native ID:0xb18) prio=5
         at java.net.SocketInputStream.socketRead(Native Method)
         at java.net.SocketInputStream.read(SocketInputStream.java, Compiled Code)
         at org.apache.tomcat.service.connector.TcpConnector.receiveFully(TcpConnector.java, Compiled Code)
         at org.apache.tomcat.service.connector.TcpConnector.receive(TcpConnector.java, Compiled Code)
         at org.apache.tomcat.service.connector.Ajp13ConnectionHandler.processConnection(Ajp13ConnectionHandler.java, Compiled Code)
         at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java, Compiled Code)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java, Compiled Code)
         at java.lang.Thread.run(Thread.java:479)
    "Thread-31" (TID:0x5fa9e48, sys_thread_t:0x22080228, state:CW, native ID:0xb2c) prio=5
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java, Compiled Code)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java, Compiled Code)
         at java.lang.Thread.run(Thread.java:479)
    "Thread-30" (TID:0x5fa9e98, sys_thread_t:0x22080140, state:CW, native ID:0x908) prio=5
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java, Compiled Code)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java, Compiled Code)
         at java.lang.Thread.run(Thread.java:479)
    "Thread-29" (TID:0x5fa9ee8, sys_thread_t:0x2207e758, state:CW, native ID:0x74c) prio=5
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java, Compiled Code)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java, Compiled Code)
         at java.lang.Thread.run(Thread.java:479)
    "Thread-28" (TID:0x5fa9f38, sys_thread_t:0x22080518, state:R, native ID:0x2fc) prio=5
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:414)
         at java.net.ServerSocket.implAccept(ServerSocket.java:242)
         at java.net.ServerSocket.accept(ServerSocket.java:224)
         at org.apache.tomcat.service.PoolTcpEndpoint.acceptSocket(PoolTcpEndpoint.java:286)
         at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java, Compiled Code)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java, Compiled Code)
         at java.lang.Thread.run(Thread.java:479)
    "Thread-27" (TID:0x5fa9b58, sys_thread_t:0x2207ff00, state:CW, native ID:0xa7c) prio=5
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:424)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java, Compiled Code)
         at java.lang.Thread.run(Thread.java:479)
    "Thread-26" (TID:0x5fa9ba8, sys_thread_t:0x2207fd90, state:CW, native ID:0xa70) prio=5
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:424)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java, Compiled Code)
         at java.lang.Thread.run(Thread.java:479)
    "Thread-25" (TID:0x5fa9bf8, sys_thread_t:0x2207fb78, state:CW, native ID:0x4d4) prio=5
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:424)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java, Compiled Code)
         at java.lang.Thread.run(Thread.java:479)
    "Thread-24" (TID:0x5fa9ca0, sys_thread_t:0x2207f8f0, state:CW, native ID:0x7c8) prio=5
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:424)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java, Compiled Code)
         at java.lang.Thread.run(Thread.java:479)
    "Thread-23" (TID:0x5fa9c98, sys_thread_t:0x22055c18, state:CW, native ID:0xa60) prio=5
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:424)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java, Compiled Code)
         at java.lang.Thread.run(Thread.java:479)
    "Thread-22" (TID:0x5fa94a0, sys_thread_t:0x220556a0, state:CW, native ID:0x68c) prio=5
         at java.lang.Object.wait(Native Method)
         at org.apache.tomcat.util.ThreadPool$MonitorRunnable.run(ThreadPool.java, Compiled Code)
         at java.lang.Thread.run(Thread.java:479)
    "Thread-21" (TID:0x5fa94f0, sys_thread_t:0x220555b8, state:R, native ID:0xb24) prio=5
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:414)
         at java.net.ServerSocket.implAccept(ServerSocket.java:242)
         at java.net.ServerSocket.accept(ServerSocket.java:224)
         at org.apache.tomcat.service.PoolTcpEndpoint.acceptSocket(PoolTcpEndpoint.java:286)
         at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java, Compiled Code)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java, Compiled Code)
         at java.lang.Thread.run(Thread.java:479)
    "Thread-20" (TID:0x5fa9540, sys_thread_t:0x22055448, state:CW, native ID:0x664) prio=5
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:424)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java, Compiled Code)
         at java.lang.Thread.run(Thread.java:479)
    "Thread-19" (TID:0x5fa9590, sys_thread_t:0x22055360, state:CW, native ID:0x5c0) prio=5
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:424)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java, Compiled Code)
         at java.lang.Thread.run(Thread.java:479)
    "Thread-18" (TID:0x5fa9338, sys_thread_t:0x220551f0, state:CW, native ID:0x874) prio=5
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:424)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java, Compiled Code)
         at java.lang.Thread.run(Thread.java:479)
    "Thread-17" (TID:0x5fa9388, sys_thread_t:0x22055080, state:CW, native ID:0x4f4) prio=5
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:424)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java, Compiled Code)
         at java.lang.Thread.run(Thread.java:479)
    "Thread-16" (TID:0x5fa9480, sys_thread_t:0x22064cf8, state:CW, native ID:0x814) prio=5
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:424)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java, Compiled Code)
         at java.lang.Thread.run(Thread.java:479)
    "Thread-15" (TID:0x5fa9428, sys_thread_t:0x22064b88, state:CW, native ID:0x8ec) prio=5
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:424)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java, Compiled Code)
         at java.lang.Thread.run(Thread.java:479)
    "Thread-14" (TID:0x5fa9478, sys_thread_t:0x22064aa0, state:CW, native ID:0x24c) prio=5
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:424)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java, Compiled Code)
         at java.lang.Thread.run(Thread.java:479)
    "Thread-13" (TID:0x5fa8f68, sys_thread_t:0x22064930, state:CW, native ID:0x410) prio=5
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:424)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java, Compiled Code)
         at java.lang.Thread.run(Thread.java:479)
    "Thread-12" (TID:0x5fa8fb8, sys_thread_t:0x22064848, state:CW, native ID:0x3f0) prio=5
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:424)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java, Compiled Code)
         at java.lang.Thread.run(Thread.java:479)
    "Thread-11" (TID:0x5fa86b8, sys_thread_t:0x220607f0, state:CW, native ID:0xb28) prio=5
         at java.lang.Object.wait(Native Method)
         at org.apache.tomcat.util.ThreadPool$MonitorRunnable.run(ThreadPool.java, Compiled Code)
         at java.lang.Thread.run(Thread.java:479)
    "Thread-10" (TID:0x5fa85f0, sys_thread_t:0x22061618, state:R, native ID:0x6fc) prio=5
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:414)
         at java.net.ServerSocket.implAccept(ServerSocket.java:242)
         at java.net.ServerSocket.accept(ServerSocket.java:224)
         at org.apache.tomcat.service.PoolTcpEndpoint.acceptSocket(PoolTcpEndpoint.java:286)
         at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java, Compiled Code)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java, Compiled Code)
         at java.lang.Thread.run(Thread.java:479)
    "Thread-9" (TID:0x5fa8648, sys_thread_t:0x22061530, state:CW, native ID:0x484) prio=5
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:424)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java, Compiled Code)
         at java.lang.Thread.run(Thread.java:479)
    "Thread-8" (TID:0x5fa83f0, sys_thread_t:0x220613c0, state:CW, native ID:0x8f0) prio=5
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:424)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java, Compiled Code)
         at java.lang.Thread.run(Thread.java:479)
    "Thread-7" (TID:0x5fa8440, sys_thread_t:0x22061250, state:CW, native ID:0x94c) prio=5
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:424)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java, Compiled Code)
         at java.lang.Thread.run(Thread.java:479)
    "Thread-6" (TID:0x5fa8490, sys_thread_t:0x220610e0, state:CW, native ID:0x994) prio=5
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:424)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java, Compiled Code)
         at java.lang.Thread.run(Thread.java:479)
    "Thread-5" (TID:0x5fa84e0, sys_thread_t:0x2205a2a8, state:CW, native ID:0x530) prio=5
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:424)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java, Compiled Code)
         at java.lang.Thread.run(Thread.java:479)
    "Thread-4" (TID:0x5fa8120, sys_thread_t:0x2205a138, state:CW, native ID:0x730) prio=5
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:424)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java, Compiled Code)
         at java.lang.Thread.run(Thread.java:479)
    "Thread-3" (TID:0x5fa8170, sys_thread_t:0x2205a050, state:CW, native ID:0x688) prio=5
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:424)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java, Compiled Code)
         at java.lang.Thread.run(Thread.java:479)
    "Thread-2" (TID:0x5fa81c0, sys_thread_t:0x2205a560, state:CW, native ID:0x3c0) prio=5
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:424)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java, Compiled Code)
         at java.lang.Thread.run(Thread.java:479)
    "Thread-1" (TID:0x5fa8218, sys_thread_t:0x22053520, state:CW, native ID:0x8fc) prio=5
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:424)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java, Compiled Code)
         at java.lang.Thread.run(Thread.java:479)
    "StandardManager" (TID:0x5fa1158, sys_thread_t:0x220596a0, state:CW, native ID:0x724) prio=5
         at java.lang.Thread.sleep(Native Method)
         at org.apache.tomcat.session.StandardManager.threadSleep(StandardManager.java, Compiled Code)
         at org.apache.tomcat.session.StandardManager.run(StandardManager.java, Compiled Code)
         at java.lang.Thread.run(Thread.java:479)
    "StandardManager" (TID:0x5f9d178, sys_thread_t:0x22031d18, state:CW, native ID:0xaa0) prio=5
         at java.lang.Thread.sleep(Native Method)
         at org.apache.tomcat.session.StandardManager.threadSleep(StandardManager.java, Compiled Code)
         at org.apache.tomcat.session.StandardManager.run(StandardManager.java, Compiled Code)
         at java.lang.Thread.run(Thread.java:479)
    "StandardManager" (TID:0x5f872f8, sys_thread_t:0x21c8b718, state:CW, native ID:0x880) prio=5
         at java.lang.Thread.sleep(Native Method)
         at org.apache.tomcat.session.StandardManager.threadSleep(StandardManager.java, Compiled Code)
         at org.apache.tomcat.session.StandardManager.run(StandardManager.java, Compiled Code)
         at java.lang.Thread.run(Thread.java:479)
    "Thread-0" (TID:0x5f4e670, sys_thread_t:0x21b0eac0, state:CW, native ID:0x8bc) prio=5
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java, Compiled Code)
         at org.apache.tomcat.util.Queue.pull(Queue.java, Compiled Code)
         at org.apache.tomcat.logging.LogDaemon$1.run(TomcatLogger.java, Compiled Code)
         at org.apache.tomcat.logging.LogDaemon.run(TomcatLogger.java, Compiled Code)
    "SymcJIT-LazyCompilation-1" (TID:0x5f2e4f8, sys_thread_t:0x20e977d8, state:CW, native ID:0x458) prio=1
         at SymantecJITCompilationThread.DoCompileMethod(Native Method)
         at SymantecJITCompilationThread.run(JITcompilationthread.java, Compiled Code)
    "SymcJIT-LazyCompilation-0" (TID:0x5f2e540, sys_thread_t:0x20e9b6d0, state:CW, native ID:0x9bc) prio=1
         at SymantecJITCompilationThread.DoCompileMethod(Native Method)
         at SymantecJITCompilationThread.run(JITcompilationthread.java, Compiled Code)
    "SymcJIT-LazyCompilation-PA" (TID:0x5f2e508, sys_thread_t:0x20e9b560, state:CW, native ID:0x820) prio=10
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:424)
         at SymantecJITCompilationThread.run(JITcompilationthread.java, Compiled Code)
    "Finalizer" (TID:0x5f29320, sys_thread_t:0x20dddec0, state:CW, native ID:0x4e8) prio=8
         at java.lang.Object.wait(Native Method)
         at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java, Compiled Code)
         at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java, Compiled Code)
         at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:174)
    "Reference Handler" (TID:0x5f293b0, sys_thread_t:0x20ddc7d0, state:CW, native ID:0x55c) prio=10
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:424)
         at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:114)
    "Signal dispatcher" (TID:0x5f293e0, sys_thread_t:0x20dda218, state:R, native ID:0xa1c) prio=5
    Monitor Cache Dump:
    org.apache.tomcat.util.ThreadPool$ControlRunnable@5FA8178/6FF4140: <unowned>
         Waiting to be notified:
         "Thread-3" (0x2205a050)
    java.net.PlainSocketImpl@5FA7DC0/6FF18C8: owner "Thread-10" (0x22061618) 1 entry
    org.apache.tomcat.util.ThreadPool$ControlRunnable@5FA8128/6FF4248: <unowned>
         Waiting to be notified:
         "Thread-4" (0x2205a138)
    SymantecJITCompilationThread@5F2E540/6C1F6A0: <unowned>
         Waiting to be notified:
         "SymcJIT-LazyCompilation-PA" (0x20e9b560)
    org.apache.tomcat.util.ThreadPool$MonitorRunnable@5FAA1D8/6FFF340: <unowned>
         Waiting to be notified:
         "Thread-33" (0x22092f98)
    org.apache.tomcat.util.ThreadPool$ControlRunnable@5FA95D8/6FFADA8: <unowned>
         Waiting to be notified:
         "Thread-20" (0x22055448)
    org.apache.tomcat.util.ThreadPool$ControlRunnable@5FA81C8/6FF32F8: <unowned>
         Waiting to be notified:
         "Thread-2" (0x2205a560)
    org.apache.tomcat.util.ThreadPool$ControlRunnable@5FA9598/6FFAC90: <unowned>
         Waiting to be notified:
         "Thread-19" (0x22055360)
    org.apache.tomcat.util.ThreadPool$ControlRunnable@5FA8448/6FF4978: <unowned>
         Waiting to be notified:
         "Thread-7" (0x22061250)
    org.apache.tomcat.util.ThreadPool$ControlRunnable@5FA9C50/6FFBAF8: <unowned>
         Waiting to be notified:
         "Thread-24" (0x2207f8f0)
    org.apache.tomcat.util.ThreadPool$ControlRunnable@5FA9430/6FFA840: <unowned>
         Waiting to be notified:
         "Thread-15" (0x22064b88)
    org.apache.tomcat.util.ThreadPool$ControlRunnable@5FA9C00/6FFC850: <unowned>
         Waiting to be notified:
         "Thread-25" (0x2207fb78)
    org.apache.tomcat.util.ThreadPool$ControlRunnable@5FA84E8/6FF4350: <unowned>
         Waiting to be notified:
         "Thread-5" (0x2205a2a8)
    org.apache.tomcat.util.ThreadPool$MonitorRunnable@5FA94A8/6FFAFB8: <unowned>
         Waiting to be notified:
         "Thread-22" (0x220556a0)
    org.apache.tomcat.util.Queue@5F4E6C0/6D4B798: <unowned>
         Waiting to be notified:
         "Thread-0" (0x21b0eac0)
    org.apache.tomcat.util.ThreadPool$ControlRunnable@5FA8498/6FF4458: <unowned>
         Waiting to be notified:
         "Thread-6" (0x220610e0)
    java.net.PlainSocketImpl@5FA9768/6FFB970: owner "Thread-28" (0x22080518) 1 entry
    org.apache.tomcat.util.ThreadPool$ControlRunnable@5FA8F70/6FFA630: <unowned>
         Waiting to be notified:
         "Thread-13" (0x22064930)
    org.apache.tomcat.util.ThreadPool$ControlRunnable@5FA9B60/6FFCA60: <unowned>
         Waiting to be notified:
         "Thread-27" (0x2207ff00)
    org.apache.tomcat.util.ThreadPool$ControlRunnable@5FA9740/6FFB9F0: <unowned>
         Waiting to be notified:
         "Thread-23" (0x22055c18)
    org.apache.tomcat.util.ThreadPool$ControlRunnable@5FA9340/6FFAB88: <unowned>
         Waiting to be notified:
         "Thread-18" (0x220551f0)
    org.apache.tomcat.util.ThreadPool$ControlRunnable@5FA8F20/6FFA738: <unowned>
         Waiting to be notified:
         "Thread-14" (0x22064aa0)
    java.lang.ref.ReferenceQueue$Lock@5F29338/6BF89C0: <unowned>
         Waiting to be notified:
         "Finalizer" (0x20dddec0)
    org.apache.tomcat.util.ThreadPool$ControlRunnable@5FA83F8/6FF4A80: <unowned>
         Waiting to be notified:
         "Thread-8" (0x220613c0)
    org.apache.tomcat.util.ThreadPool$ControlRunnable@5FA93E0/6FFA948: <unowned>
         Waiting to be notified:
         "Thread-16" (0x22064cf8)
    java.net.PlainSocketImpl@5FA8FE8/6FF9860: owner "Thread-21" (0x220555b8) 1 entry
    java.lang.ref.Reference$Lock@5F293C0/6BF84B8: <unowned>
         Waiting to be notified:
         "Reference Handler" (0x20ddc7d0)
    org.apache.tomcat.util.ThreadPool$ControlRunnable@5FA8FC0/6FF98E0: <unowned>
         Waiting to be notified:
         "Thread-12" (0x22064848)
    org.apache.tomcat.util.ThreadPool$ControlRunnable@5FA9BB0/6FFC958: <unowned>
         Waiting to be notified:
         "Thread-26" (0x2207fd90)
    org.apache.tomcat.util.ThreadPool$ControlRunnable@5FA9390/6FFAA80: <unowned>
         Waiting to be notified:
         "Thread-17" (0x22055080)
    org.apache.tomcat.util.ThreadPool$ControlRunnable@5FA8650/6FF4B88: <unowned>
         Waiting to be notified:
         "Thread-9" (0x22061530)
    org.apache.tomcat.util.ThreadPool$ControlRunnable@5FA9E50/6FFF128: <unowned>
         Waiting to be notified:
         "Thread-31" (0x22080228)
    org.apache.tomcat.util.ThreadPool$ControlRunnable@5FA8220/6FF31A8: <unowned>
         Waiting to be notified:
         "Thread-1" (0x22053520)
    org.apache.tomcat.util.ThreadPool$ControlRunnable@5FA9EF0/6FFEF18: <unowned>
         Waiting to be notified:
         "Thread-29" (0x2207e758)
    org.apache.tomcat.util.ThreadPool$MonitorRunnable@5FA86C0/6FF5858: <unowned>
         Waiting to be notified:
         "Thread-11" (0x220607f0)
    org.apache.tomcat.util.ThreadPool$ControlRunnable@5FA9EA0/6FFF020: <unowned>
         Waiting to be notified:
         "Thread-30" (0x22080140)
    Registered Monitor Dump:
    SymcJIT Method Monitor: <unowned>
    SymcJIT Method Monitor: <unowned>
    SymcJIT Method Monitor: <unowned>
    SymcJIT Lazy Queue Lock: <unowned>
         Waiting to be notified:
         "SymcJIT-LazyCompilation-0" (0x20e9b6d0)
         "SymcJIT-LazyCompilation-1" (0x20e977d8)
    SymcJIT Method Monitor: <unowned>
    SymcJIT Method List Monitor: <unowned>
    SymcJIT Lock: <unowned>
    utf8 hash table: <unowned>
    JNI pinning lock: <unowned>
    JNI global reference lock: <unowned>
    BinClass lock: <unowned>
    Class linking lock: <unowned>
    System class loader lock: <unowned>
    Code rewrite lock: <unowned>
    Heap lock: <unowned>
    Monitor cache lock: owner "Signal dispatcher" (0x20dda218) 1 entry
    Thread queue lock: owner "Signal dispatcher" (0x20dda218) 1 entry
         Waiting to be notified:
         "Thread-34" (0x2f4158)
    Monitor registry: owner "Signal dispatcher" (0x20dda218) 1 entry
    </pre>
    Regards,
    Prashant

    No. we are getting the thread dumps only on the production server, and it being running on production, we cannot try it out with newer versions. However, we have so far been unable to simulate the thread dumps on our machines using the same version.

  • Thread dump: any way to do it programmaticly?

    Sun introduced a new deadlock detection utility with 1.4.1: if you type invoke with Ctrl Break (windoze) / Ctrl + (unix) on the shell command line which launched your jvm, you will get a thread dump to std out
         http://java.sun.com/j2se/1.4.2/docs/guide/vm/
    But I am faced with a situation where I would like to programmaticly dump the thread state, that is, from my java code itself I would like to issue a command to thread dump to some OutputStream. (In my case, I would like to do this if my program detected some problem that will cause it to abort, and I would like to do the thread dump first so that I can inspect it afterwards and see what the thread state was at the time.)
    Does anyone know how to do this?
    Is there a way of overriding System.in, say, so that you can send the chars equivalent to Ctrl Break to the jvm?

    You can look at the new APIs in JDK 5.0: getStackTrace
    and Thread.getAllStackTraces.
    -Alexis

  • Output of the thread dump taken in unix for weblogic using kill -3 oprion

    Hi
    I am executing the kill -3 <PID> command in the unix box for weblogic server to get the thread dump.
    I am not able to find where the output of the thread dump is getting saved.Please advice.
    Regards
    Abhishek

    Hi,
    You can following the below link which shows you how to take thread dumps in *9 different ways* and where they get written also
    Topic: Taking Thread Dumps - 9 Ways
    http://middlewaremagic.com/weblogic/?p=823
    Regards,
    Ravish Mody
    http://middlewaremagic.com/weblogic/?page_id=1749
    Come, Join Us and Experience The Magic…

  • Need help interpreting jvm thread dump (linux)

    hi,
    i'm using jre1.4.2 and running AS3 Linux kernel version 2.4.
    i grep'ed for my java process id, and did a kill -3 on it to get the thread dump:
    ps -ef |grep Eatroot 3936 3845 68 16:12 pts/2 00:00:05 java EatCpu
    root 3948 30293 0 16:12 pts/3 00:00:00 grep Eat
    kill -3 3936
    thread dump:
    java EatCpuFull thread dump Java HotSpot(TM) Client VM (1.4.2_05-b04 mixed mode):
    "Thread-0" prio=1 tid=0x081126b8 nid=0xf60 runnable [aa7e0000..aa7e087c]
    at EatCpu.run(EatCpu.java:31)
    "Signal Dispatcher" daemon prio=1 tid=0x080a6a58 nid=0xf60 waiting on condition [0..0]
    "Finalizer" daemon prio=1 tid=0x08092ee8 nid=0xf60 in Object.wait() [aad4d000..aad4d87c]
    at java.lang.Object.wait(Native Method)
    - waiting on <0xaaed0490> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:111)
    - locked <0xaaed0490> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:127)
    at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)
    "Reference Handler" daemon prio=1 tid=0x08091498 nid=0xf60 in Object.wait() [aadce000..aadce87c]
    at java.lang.Object.wait(Native Method)
    - waiting on <0xaaed0380> (a java.lang.ref.Reference$Lock)
    at java.lang.Object.wait(Object.java:429)
    at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:115)
    - locked <0xaaed0380> (a java.lang.ref.Reference$Lock)
    "main" prio=1 tid=0x0805bae0 nid=0xf60 runnable [bfffc000..bfffcc98]
    at EatCpu.main(EatCpu.java:22)
    "VM Thread" prio=1 tid=0x08090238 nid=0xf60 runnable
    "VM Periodic Task Thread" prio=1 tid=0x080a9248 nid=0xf60 waiting on condition
    "Suspend Checker Thread" prio=1 tid=0x080a6020 nid=0xf60 runnable
    i read that "nid" in the thread dump is suppose to correspond to PID. when i give the -m option for the "ps" command (for all threads), i see:
    ps -efm |grep Eatroot 3936 3845 43 16:12 pts/2 00:00:04 java EatCpu
    root 3937 3936 0 16:12 pts/2 00:00:00 java EatCpu
    root 3938 3936 0 16:12 pts/2 00:00:00 java EatCpu
    root 3939 3936 0 16:12 pts/2 00:00:00 java EatCpu
    root 3940 3936 0 16:12 pts/2 00:00:00 java EatCpu
    root 3941 3936 0 16:12 pts/2 00:00:00 java EatCpu
    root 3942 3936 0 16:12 pts/2 00:00:00 java EatCpu
    root 3943 3936 0 16:12 pts/2 00:00:00 java EatCpu
    root 3944 3936 30 16:12 pts/2 00:00:03 java EatCpu
    root 3950 30293 0 16:12 pts/3 00:00:00 grep Eat
    >
    but nid for all threads in the thead dump is the PID of my main process, 3936 (0xf60). is there a way to correlate the PIDs produced by "ps -efm" to the threads in the thread dump?
    thanks!
    -annie

    i upgraded to 1.5 version of java, and could see distinct "nids" in the thread dump after that..

  • Can I get a native dump (Dr. Watson) when JNI code causes an exception?

    Is there a way to get the JVM to just not trap an exception, so that we can get a native dump? I have tried -XX:OnError="drwtsn32 -p %p". This did produce a Dr. Watson dump, but not a good one. I placed a deliberate error in the code, and called it outside of java, and got a good log file (with the fault in my DLL), but the same module called via JNI gave me a bad log file, with the fault point in ntdll.dll.
    This is happening in java 1.4.2. In the field, the jvm is provided by IBM Websphere 6 on Windows 2000. I'm unable to duplicate the error, but am running the above mentioned tests in my Eclipse 3.1 + Weblogic 8.1development environment on Win XP.

    Queer!
    This is not an error message I see when I try to execute a program not in my path!
    And when I do not specify libraries to be linked, I get a linking error!
    This seems to be a preprocessor error.
    What could it possibly be?
    Do you have the correct calling convention in the case of #ifdef __cplusplus ??
    I guess that should have been already done by your javah.
    I wonder.
    I also wonder if cl.exe actually stands for "command line" exe
    Can you pls send me all the files at [email protected] ??
    cheers

  • Program hangs, can't get thread dump

    Hello
    I have a Java program which sometimes works OK untill the very end, but sometimes just hangs in a random moment and doesn't react to Ctrl+C or Ctrl+Break. Process doesn't use CPU, so I guess it isn't something like infinite loop (I actually cannot think of places in my program where this kind of loop may occur). I tried to get thread dump to see if there are any deadlocks, but Ctrl+Break doesn't work and jstack doesn't work also (I've read that there is -F option, but it isn't available on Windows). Also I tried to connect to a process with Java Visual VM - doesn't help too (just says 'Connecting...' forever).
    What else can I do to find out what's going on in my programm and fix it?
    I tried to run it with JDK 1.6.0_07 and 1.6.0_16. I'm using Windows Vista Enterprise SP1, 64-bit.
    Thanks in advance, Yulia.
    Edited by: Yulia_Dubinina on Oct 26, 2009 11:58 PM
    Edited by: Yulia_Dubinina on Oct 27, 2009 12:13 AM

    Yulia_Dubinina wrote:
    Yesterday I tried to start my program, connect with Java Visual VM to it and see how threads visualisation will look like in a moment when program hangs. My programm died after about 50 min and all info which I was able to see was about this period of time (e.g. a timeline diagram stopped changing and the last time mark was 49:23), but Java Visual VM was still connected to a process. I tried to press Thread Dump button, it worked, but there was nothing 'criminal' on the dump it provided. So I guess maybe it's not actual thread dump, it's something that Java Visual VM was able to get before process hanged.
    I don't have much experience in resolving this kind of problems, so any advices will be great appreciated.
    Edited by: Yulia_Dubinina on Oct 27, 2009 2:14 PMTurn on verbose GC and see if you got lots and lots of full GC when the freeze happens. A full GC can take several minutes if you have a bad configuration (where e.g. memory has been paged out to disk)

  • How to get complete Java thread dump?

    I suspect a deadlock on a IWS 6.0SP5 running on Solaris 8 with Sun JDK 1.4.1, how can I make a full thread dump?
    I have enabled LogStdout and LogStderr in magnus.conf.
    regards
    Lars Krog-Jensen

    Thanx for your reply,
    but there are 2 ns-httpd processes, which one do I
    send the kill to.
    If I send it to the wrong ns-httpd the server
    restarts.
    regards Lars Krog-JensenIt's the last one in the "PID chain" (the last child process) and the one using the most memory.

  • How to get thread dump in case of out of memory error.

    Hi Team,
    In case of out of memory, heap dump can be generated using option '- XX:+HeapDumpOnOutOfMemoryError'. Is is possible to generate thread dump too using any option? Can it be done using option -XX:OnOutOfMemoryError="<cmd args>?
    Thanks in advance.
    Regards,
    Atul.

    Jay SenSharma wrote:
    Hi Mukul,
    Complete Steps can be Devided into 3-parts
    A). Configuring a Mail-Session
    B). Configuring WLDF Module
    C). Configuring Watch And Notification
    For detailed <A class=bodylinkwhite href="http://www.software-to-convert.com/divx-avi-conversion-software/divx-avi-to-h264-software.html"><FONT face=tahoma,verdana,sans-serif color=#000 size=1>steps</FONT></A> please refer to: <B><A class=jive-link-external href="http://jaysensharma.wordpress.com/2010/01/07/e-mail-notification-using-wldf/">http://jaysensharma.wordpress.com/2010/01/07/e-mail-notification-using-wldf/</A></B>
    <P>
    Thanks
    Jay SenSharma
    <B><A class=jive-link-external href="http://jaysensharma.wordpress.com">http://jaysensharma.wordpress.com</A> (WebLogic Wonders Are here)</B></P>
    It is just the solution for my problem, It's very useful.

Maybe you are looking for