<p>How do you generate and analyze a thread dump from a running JBoss instance?</p>

[{'answer_id': 59818, 'author': 'Teflon Ted', 'author_id': 4061, 'author_profile': 'https://Stackoverflow.com/users/4061', 'pm_score': 2, 'selected': False, 'text': '<p><a href="http://java.sun.com/developer/technicalArticles/Programming/Stacktrace/" rel="nofollow noreferrer">http://java.sun.com/developer/technicalArticles/Programming/Stacktrace/</a></p>\n\n<p>...</p>\n\n<p>"On UNIX platforms you can send a signal to a program by using the kill command. This is the quit signal, which is handled by the JVM. For example, on Solaris you can use the command kill -QUIT process_id, where process_id is the process number of your Java program.</p>\n\n<p>Alternatively you can enter the key sequence &lt;ctrl&gt;\\ in the window where the Java program was started. Sending this signal instructs a signal handler in the JVM, to recursively print out all the information on the threads and monitors inside the JVM."</p>\n\n<p>...</p>\n\n<p>"Determining the Thread States</p>\n\n<p>You will see many different threads in many different states in a snapshot from a JVM stack trace. The key used is:</p>\n\n<p>R   Running or runnable thread</p>\n\n<p>S   Suspended thread</p>\n\n<p>CW  Thread waiting on a condition variable</p>\n\n<p>MW  Thread waiting on a monitor lock</p>\n\n<p>MS  Thread suspended waiting on a monitor lock"</p>\n'}, {'answer_id': 60021, 'author': 'Matt Solnit', 'author_id': 6198, 'author_profile': 'https://Stackoverflow.com/users/6198', 'pm_score': 4, 'selected': True, 'text': '<p>There is a JBoss-specific method that is slightly more user-friendly:</p>\n\n<p><a href="http://community.jboss.org/wiki/GenerateAThreadDumpWithTheJMXConsole" rel="nofollow noreferrer">http://community.jboss.org/wiki/GenerateAThreadDumpWithTheJMXConsole</a></p>\n\n<p>This is especially useful when you don\'t have direct access to the host machine (which "kill" would require).</p>\n'}, {'answer_id': 60265, 'author': 'Andrei', 'author_id': 2718, 'author_profile': 'https://Stackoverflow.com/users/2718', 'pm_score': 1, 'selected': False, 'text': '<p>The stacktrace app found <a href="http://www.adaptj.com/main/download" rel="nofollow noreferrer">here</a> is also useful, especially on Windows machines when the   java app is not started from the command line.</p>\n'}, {'answer_id': 5720826, 'author': 'Vadzim', 'author_id': 603516, 'author_profile': 'https://Stackoverflow.com/users/603516', 'pm_score': 0, 'selected': False, 'text': '<p>Sometimes JBoss locks so much that even jmx-concole doesn\'t respond.\nIn such case use kill -3 on Linux and <a href="http://www.latenighthacking.com/projects/2003/sendSignal/" rel="nofollow">SendSignal</a> on Windows.</p>\n'}, {'answer_id': 11678609, 'author': 'user98761', 'author_id': 98761, 'author_profile': 'https://Stackoverflow.com/users/98761', 'pm_score': 1, 'selected': False, 'text': '<p><code>Thread.getAllStackTraces()</code> (since Java 1.5)</p>\n'}, {'answer_id': 16665089, 'author': 'Stephan', 'author_id': 363573, 'author_profile': 'https://Stackoverflow.com/users/363573', 'pm_score': 1, 'selected': False, 'text': '<p>Two options:</p>\n<p><strong>OPTION 1</strong> <em>Generate a thread dump using JMX Console</em></p>\n<p>In order to generate a thread dump:</p>\n<ol>\n<li>Open the JMXConsole (for example: <code>http://localhost:8080</code> )</li>\n<li>Navigate to <code>jboss.system:type=ServerInfo</code> mbean (<em><strong>hint:</strong></em> you can probably just <kbd>CTRL</kbd>-<kbd>F</kbd> and enter type=ServerInfo in the dialog box)</li>\n<li>Click on the link for the Server Info mbean.</li>\n<li>Navigate to the bottom where it says <code>listThreadDump</code></li>\n<li>Click it and get your thread dump</li>\n</ol>\n<p>Notes:</p>\n<p>If you are using Internet Explorer you should use <code>File &gt; Save As</code> to save the output instead of copying the data to a text editor.  For some reason when you copy the text from Internet Explorer the line breaks are not copied and all of the output ends up on a single line.</p>\n<p><strong>OPTION 2</strong> <em>Generate a Thread Dump using Twiddle</em></p>\n<p>Alternatively you can use twiddle to execute the <code>listThreadDump()</code> method and pipe the returned HTML directly to file. Use this command line:</p>\n<pre><code>&lt;JBOSS_HOME&gt;/bin/twiddle invoke &quot;jboss.system:type=ServerInfo&quot; listThreadDump &gt; threads.html\n</code></pre>\n'}, {'answer_id': 16766884, 'author': 'Vadzim', 'author_id': 603516, 'author_profile': 'https://Stackoverflow.com/users/603516', 'pm_score': 0, 'selected': False, 'text': '<p><a href="https://community.jboss.org/wiki/ThreadDumpJSP" rel="nofollow">https://community.jboss.org/wiki/ThreadDumpJSP</a> page features standalone self-contained threaddump.war that can be used without JMX.</p>\n'}]
['https://Stackoverflow.com/questions/59787', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4061/']