Generate thread dump without sending ctrl-break on Win32

I have a server application running as a service on Win2k (we use Service+ to do this). The output of the console is piped to a text file which we can monitor. But, I can't figure out how to generate a thread dump while running in this configuration. Does anyone know if Service+ can be configured to do this, or if it can be achieved programmatically (how does Sun spit out the thread info when it gets the request).
Thanks,
Larry

If you are running a java application on a Windows server. You can press Ctrl-Break, and a thread dump will be displayed in the console. This thread dump is a list of all the threads running in the JVM, and the line of code they are each executing.
We'd like to be able to generate this thread dump some other way than pressing Ctrl-Break, because we don't have a console, our application is running as a service using Service .
Thanks for the reply,
Larry0AThanks for the reply,
Larry

Similar Messages

  • What is the key Combination to send CTRL-BREAK Key sequence on MacBook Pro

    I need to send a CTRL-BREAK key sequence to a router via console terminal. what is the key Combination to send CTRL-BREAK Key sequence on MacBook Pro
    I can't seem to find any documentation on how to send a CTRL-BREAK sequence
    TIA

    In the Terminal application, select the 'Help > Terminal Help' menu item. In the help window that opens, click on the link 'Shortcuts for Terminal.' Scroll down to the line beginning 'Send break.'

  • Generating thread dump on java 1.5

    Hello,
    I have an issue that I need an advise for.
    I have a Java process that is stuck. I suspect it is in a deadlock. The version is 1.5, and the trouble is that the process is run via a 3rd party software, meaning I am not able to connect to its shell.
    Any ideas how I can do it?
    Thanks,

    rdrbnhd wrote:
    Hello,
    I have an issue that I need an advise for.
    I have a Java process that is stuck. I suspect it is in a deadlock. The version is 1.5, and the trouble is that the process is run via a 3rd party software, meaning I am not able to connect to its shell.If you have access to the code of the Java process make a logger for it and trace where things are in the code when you have to break.

  • WL 7.0 thread dump question

    Hi,
    I am using weblogic 7.0 windows 2000. I have seen unique behaviour with this,
    if the server is not accessed for prolonged time, say overnight and in the morning
    if I want to take thread dump(by hitting Ctrl+break) it will not work. I need
    to restart server to get thread dump, any idea about this?
    Yogesh

    Ctrl+break is a JVM interrupt command, not WLS.
    Is the server accessible? I mean does it respond for PING
    BTW, what JDk you are using?
    Kumar
    Yogesh wrote:
    Hi,
    I am using weblogic 7.0 windows 2000. I have seen unique behaviour with this,
    if the server is not accessed for prolonged time, say overnight and in the morning
    if I want to take thread dump(by hitting Ctrl+break) it will not work. I need
    to restart server to get thread dump, any idea about this?
    Yogesh

  • 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 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.

  • Full thread dump

    Hi my friend
    I want to dump full thread , I know use CTRL-BREAK to dump the full thread on windows.
    but I don`t know how to dump it on UNIX,
    somebody say use kill -QUIT
    but how to use this command, I try open another window to set this command , but nothing happen.
    my OS. is solories 2.6
    by the way , somebody knows how to dump cach monitor.
    Thanks in advance.
    -uya

    The command "kill -QUIT <pid>" works, at least on the Solaris JVM I am using (JDK 1.3.1), where <pid> is the process ID of the java process from which you want a stack dump. Alternatively, setting the terminal to send the QUIT signal on pressing of a given key should also suffice (see the manual page for "stty").

  • 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 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.

  • Where we can know about the stuck threads without taking thread dump.

    Hi Everyone,
    Where we can View/know about the stuck threads without taking thread dump.
    Thank You

    Hi!
    WebLogic Server diagnoses a thread as stuck if it is continually working (not idle) for a set period of time. You can tune stuck threads in the Weblogic Server.
    You can tune a server’s thread detection behavior by changing the length of time before a thread is diagnosed as stuck, and by changing the frequency with which the server checks for stuck threads.
    It can be configured using below mentioned 2 parameters. These can be configured from Admin console -> Servers ->Configuration > Tuning tab.
    1)Stuck Thread Max Time
    2)Stuck Thread Timer Interval
    Although you can change the criteria WebLogic Server uses to determine whether a thread is stuck, you cannot change the default behavior of setting the “warning” and “critical” health states when all threads in a particular execute queue become stuck.
    There is a parameter "Stuck Thread Count" which can be configured from Console
    (Servers -> Configuration ->Overload -> Stuck Thread count) which helps to transition the Server to FAILED state once the stuck threads reaches the value.
    You can also use "OverloadProtectionMBean" for tuning. In Weblogic Server 9.x and later, it is recommended that you use the "ServerFailureTriggerMBean" in the "OverloadProtectionMBean".The ServerFailureTriggerMBean transitions the server to a FAILED state after the specified number of stuck threads are detected.The OverloadProtectionMBean has options to suspend or shutdown a failed server.
    WebLogic Server checks for stuck threads periodically. If all application threads are stuck, a server instance marks itself failed, if configured to do so, exits. You can configure Node Manager or a third-party high-availability solution to restart the server instance for automatic failure recovery.
    You can configure these actions to occur when not all threads are stuck, but the number of stuck threads have exceeded a configured threshold:
    - Shut down the Work Manager if it has stuck threads. A Work Manager that is shut down will refuse new work and reject existing work in the queue by sending a rejection message. In a cluster, clustered clients will fail over to another cluster member.
    - Shut down the application if there are stuck threads in the application. The application is shutdown by bringing it into ADMIN mode. All Work Managers belonging to the application are shut down, and behave as described above.
    - Mark the server instance as failed and shut it down it down if there are stuck threads in the server. In a cluster, clustered clients that are connected or attempting to connect will fail over to another cluster member.
    You can configure the "ServerFailureTriggerMBean" in the "OverloadProtectionMBean".
    Below is documentation link for "ServerFailureTriggerMBean" methods.
    http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13945/weblogic/management/configuration/ServerFailureTriggerMBean.html
    You can use getStuckThreadCount() method to check the number of stuck threads and transition the server to Failed State once itreaches the limit.
    getStuckThreadCount:
    int getStuckThreadCount() - The number of stuck threads after which the server is transitioned into FAILED state. There are options inOverloadProtectionMBean to suspend and shutdown a FAILED server. By default, the server continues to run in FAILED state. If the StuckThreadCount value is set to zero then the server never transitions into FAILED server irrespective of the number of stuck threads.
    Returns:
    The StuckThreadCount value
    Default Value:
    0
    Maximum Value:
    java.lang.Integer.MAX_VALUE
    Minimum Value:
    0
    Below is documentation link for "OverloadProtectionMBean" methods.
    http://download.oracle.com/docs/cd/E11035_01/wls100/javadocs_mhome/weblogic/management/configuration/OverloadProtectionMBean.html
    In the Admin console, you can set the "FailureAction" under Servers->Configuration->Overload to force shutdown the managed server once the server is in Failed state.
    The OverloadProtectionMBean has a method getFailureAction to achieve the same.
    getFailureAction:
    String getFailureAction() - Enable automatic forceshutdown of the server on failed state. The server self-health monitoring detects fatal failures and mark the server as failed. The server can be restarted using NodeManager or a HA agent.
    Valid Values:
    OverloadProtectionMBean.NO_ACTION, OverloadProtectionMBean.FORCE_SHUTDOWN, OverloadProtectionMBean.ADMIN_STATE
    If you start the managed servers using node manager, you can enable "Auto Kill if Failed" and "Auto Restart" in the Admin console, under Servers-> configuration->Health Monitoring. Node Manager will take care of restarting the managed server if you enable "Auto Restart".
    You can also configure the "Stuck Thread Count" and "Failure Action" to "Force Immediate shutdown of the Server" from Admin console under servers-> configuration-> Overload. This will help you to shutdown the server when the stuck thread count is reached. But there is no way to release the threads once they are stuck from the configuration.
    Suppose if you set the value of the Stuck Thread Count to 20, The server will be transitioned to failed state once the count reaches 20 and if you enable the Failure Action, the server self-health monitoring detects fatal failures and mark the server as failed.
    Depending on how you are starting the servers (custom scripts or Node Manager or startup scripts,...), you can restart the servers.
    For more details on this please refer to below link:
    http://www.oracle.com/technetwork/articles/entarch/workload-management-088692.html
    Hope this helps.
    Thanks,
    Cris

  • Redirecting JVM thread dump to a file

    The full thread dump of the JVM can be obtained by pressing ctrl-break in windows on the prompt from which the JVM is run and on solaris by executing the command "kill -QUIT pid" where pid is the process id of the JVM.
    The thread dump will be printed on the console by default. But the requirement is to redirect this to a file. The following code redirects the dump to a file "Dump.txt".
    System.out.close();
    System.setOut(new PrintStream(new FileOutputStream("Dump.txt")));
    Here we need to close the standard output stream "System.out" prior to redirecting it to a file. This is because if System.setOut is done without closing it the JVM still gives the thread dump on the initial standard output i.e., console. But if console is closed once we cannot get it back for the rest of the running time of the JVM.
    IS THERE ANY SOLUTION TO THIS PROBLEM OF REDIRECTING DUMP TO A FILE, WITHOUT CLOSING THE STANDARD OUTPUT? The application should be able to get the standard output(console) back whenever it's required.

    Hi,
    I think that you can use a API for logs, as Log4J from Apache or Logger in java.util.logging... both are very simple...
    good luck.
    Mad.

  • 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

  • Thread Dump issue with LD_ASSUME_KERNEL=2.4.1

    Hi ,
    When I take Thread Dump using 'jstack <PID>' in JDK 1.5 it givss me "sun.jvm.hotspot.debugger.DebuggerException" in the dump nothing more
    I set LD_ASSUME_KERNEL=2.4.1 in my server to avaoid some other issue ( JVM crash some times)
    Surprisingly, I can not stop my server ( my java process ) after that using our Shutdow scripts , Ctrl C or even "kill -9 <PID>",
    I have to restart the machine or manually release uncleaned resources that my server occupied and restart the server
    This happens Redhar 9 as well as in Linux ES.
    Anybody faced similar problem?
    Any help or information regarding this is highly apprecialted
    Vasu
    Thread Dump Output:
    Caused by: sun.jvm.hotspot.debugger.DebuggerException: get_thread_regs failed for a lwp
    at sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal.getThreadIntegerRegisterSet0(Native Meth
    od)
    at sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal.access$800(LinuxDebuggerLocal.java:34)
    at sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal$1GetThreadIntegerRegisterSetTask.doit(Li
    nuxDebuggerLocal.java:431)
    at sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal$LinuxDebuggerLocalWorkerThread.run(Linux
    DebuggerLocal.java:109)
    sun.jvm.hotspot.debugger.DebuggerException: sun.jvm.hotspot.debugger.DebuggerException: get_thread_re
    gs failed for a lwp
    at sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal$LinuxDebuggerLocalWorkerThread.execute(L
    inuxDebuggerLocal.java:134)
    at sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal.getThreadIntegerRegisterSet(LinuxDebugge
    rLocal.java:437)
    at sun.jvm.hotspot.debugger.linux.LinuxThread.getContext(LinuxThread.java:48)
    at sun.jvm.hotspot.runtime.linux_x86.LinuxX86JavaThreadPDAccess.getCurrentFrameGuess(LinuxX86
    JavaThreadPDAccess.java:75)
    at sun.jvm.hotspot.runtime.JavaThread.getCurrentFrameGuess(JavaThread.java:252)
    at sun.jvm.hotspot.runtime.JavaThread.getLastJavaVFrameDbg(JavaThread.java:211)
    at sun.jvm.hotspot.tools.StackTrace.run(StackTrace.java:42)
    at sun.jvm.hotspot.tools.JStack.run(JStack.java:41)
    at sun.jvm.hotspot.tools.Tool.start(Tool.java:204)
    at sun.jvm.hotspot.tools.JStack.main(JStack.java:58)
    Caused by: sun.jvm.hotspot.debugger.DebuggerException: get_thread_regs failed for a lwp
    at sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal.getThreadIntegerRegisterSet0(Native Meth
    od)
    at sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal.access$800(LinuxDebuggerLocal.java:34)
    at sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal$1GetThreadIntegerRegisterSetTask.doit(Li
    nuxDebuggerLocal.java:431)
    at sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal$LinuxDebuggerLocalWorkerThread.run(Linux
    DebuggerLocal.java:109)
    sun.jvm.hotspot.debugger.DebuggerException: sun.jvm.hotspot.debugger.DebuggerException: get_thread_re
    gs failed for a lwp
    at sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal$LinuxDebuggerLocalWorkerThread.execute(L
    inuxDebuggerLocal.java:134)
    at sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal.getThreadIntegerRegisterSet(LinuxDebugge
    rLocal.java:437)

    @brain0
    I've downloaded the glic-2.3.6 sources from gnu, so I could build it from those. I'm however reluctant to do this because I really don't want to break my install.
    I do agree with you on the NPTL statement, but pvs relies on allegro, which relies on LinuxThreads. Allegro is not being ported to new versions of glibc, so that approach is unfortunately not viable.
    @iphitus
    I wasn't very specific - it's allegro as in a lisp environment.
    I think I'll try and install an old version of arch on wmware instead. Is there anywhere you can check out glibc version numbering on old arch install isos (ie. do I need arch-0.[1-9].iso)? And anywhere you can download the old isos (tried filewatcher, but a lot of the older sites seem broken)?
    Thanks for the replies,
    Mads
    PS. I noticed that you recommended slackware for old kernels in another thread. I'm however in a bit different situation as I need old versions of glibc. Furthermore I would prefer sticking to arch, but was wondering whether there were any specific reasons for not doing that.

  • 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)

  • Programatically achieving full thread dump

    Why is there no way of programmatically getting a full thread dump? Yes, in 1.5 you can use Thread.getAllStackTraces(), but there's no lock information there, so that makes it much harder if not impossible to diagnosis deadlocks. There is obviously desired/need for this functionality, see the following forum entries all of which are requesting this:
    http://forum.java.sun.com/thread.jspa?forumID=4&threadID=436356
    http://forum.java.sun.com/thread.jspa?forumID=256&threadID=268128
    http://forum.java.sun.com/thread.jspa?forumID=37&threadID=233384
    http://forum.java.sun.com/thread.jspa?forumID=257&threadID=318904
    http://forum.java.sun.com/thread.jspa?forumID=47&threadID=687674
    http://forum.java.sun.com/thread.jspa?forumID=4&threadID=153408
    For my particular instance, I have a three tier system and client's std out and std err are sent to a log file on a shared drive where I can view them. We have a mechanism whereby we can send programmatic commands to clients. So if a user reports a problem and I suspect it may be a deadlock, I can send a command to their client to do something. If there were a method like System.dumpThreads() that I could call, I could dump threads, look at the log file on the shared drive and detect a deadlock without even having to go to the users desk (some users are located in other offices). Also, the clients are started with JWS so even if I can get to a user's desk there's no way to dump threads.
    Is there some technical limitation that prevents Sun from easily implementing such functionality as System.dumpThreads()?

    You can get deadlock information and more using java.util.management.
    Why there is no one simple ready method? Dunno.
    In 5.0 you can also use command line tools: "jps" (java process status) to find out the process IDs of running Java programs, then "jstack -p <pid>" to get stack traces. Though jstack is not available on all platforms yet - notably Windows, but I think 6.0 should have it (and if you are desperate you can download a Mustang beta snapshot and grab jstack from there.)

Maybe you are looking for

  • Can i get my money back for an app that i do t want

    i just bought my first new mac pro 1 week ago, but i didnt know that the new version of OS X lion was already in this computer, so basically i purchased it for nothing.

  • Keep getting Error: 8008 Messages!!!!

    I was trying to download "I'ts kind of a funny story" Last night, and at about 480 MBs of 1.25 Gs, It would either send me an error message that the download had been disrupted and stop the download, or it would start over the entire downloading proc

  • Adobe reader android browser plugin

    Why does adobe reader not allow the mime type application/pdf in an object tag to work in a web page?  Instead it wants to download the pdf instead of viewing it in the browser like your desktop application.  All you have to do is write a library .so

  • How do I remove i06 it is messing up my text messaging

    I send a text and all the phones in my family get the message.  They also receive all the messages

  • Thinkvantage toolbox - How to disable

    I have a new X120e that came with Thinkvantage Toolbox. This tool is offensively in the way. 1. It starts with Windows and sticks a HUGE icon in the system tray. It can be disabled while running, but the settings do not stick and it shows up again up