{"id":12674,"date":"2026-09-09T12:54:39","date_gmt":"2026-09-09T18:54:39","guid":{"rendered":"https:\/\/www.mrc-productivity.com\/techblog\/?post_type=ht_kb&#038;p=12674"},"modified":"2026-09-09T12:57:08","modified_gmt":"2026-09-09T18:57:08","slug":"tomcat-thread-dump-guide","status":"publish","type":"ht_kb","link":"https:\/\/www.mrc-productivity.com\/techblog\/?ht_kb=tomcat-thread-dump-guide","title":{"rendered":"Tomcat Thread Dump Guide"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">This techblog post explains how to capture Java thread dumps from a running Tomcat JVM at 15-second intervals. The purpose is to collect a series of snapshots during peak load of your m-Power environment, so you can identify threads, requests, database calls, or other activity that may be repeatedly stalled or consuming resources.<\/p>\n\n\n\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon\">A thread dump does <strong>not <\/strong>stop or restart Tomcat. It captures a snapshot of what the JVM threads are doing at that moment while the application continues to run.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Before You Begin<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The Java Development Kit (JDK) installed on the m-Power\/Tomcat server must include the <code>jcmd<\/code> utility. You will run the commands that follow in this techblog via Windows Command Prompt (CMD) on the m-Power\/Tomcat server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>It is best to begin capturing thread dumps shortly before or during the period when the slowdown or peak load is occurring.<\/strong> A single thread dump is only one snapshot. Multiple dumps taken over time are much more useful because they can show whether the same threads remain stuck in the same operation.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1. Identify the Tomcat JVM Process ID<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Open Command Prompt (as administrator) and run:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>jcmd<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This lists running Java processes. Locate the Tomcat process and note its process ID (PID). If you cannot find your Tomcat service running the above comamnd, than you can use Windows to help identify the Tomcat service PID:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tasklist \/svc | findstr \/I \"tomcat\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">In the example below, both development (TC10DEV) and production (TC10PROD) services are found:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"\/techblogs\/images\/java_thread_dump_1.png\" alt=\"\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">2. Test a Single Thread Dump<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before starting the repeating capture, test one thread dump. Replace <code>33380 <\/code>with the actual Tomcat JVM PID:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>jcmd 33380 Thread.print > \"%USERPROFILE%\\Desktop\\tomcat-thread-dump.txt\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This will generate on the desktop a .txt file named tomcat-thread-dump.txt.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Open the generated text file and confirm that it contains a full Java thread dump.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">3. Create a Folder for the Thread Dumps<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Using CMD or File Explorer&#8217;s GUI, create a folder on the desktop to keep the repeated thread dumps together:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir \"%USERPROFILE%\\Desktop\\thread-dumps\"<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">4. Capture a Thread Dump Every 15 Seconds<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Replace <code><code>33380<\/code><\/code> with your actual Tomcat JVM PID, then run the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>jcmd 33380 Thread.print > \"%USERPROFILE%\\Desktop\\thread-dumps\\tomcat-thread-1.txt\" &amp;\ntimeout \/t 15 \/nobreak >nul &amp;\n\njcmd 33380 Thread.print > \"%USERPROFILE%\\Desktop\\thread-dumps\\tomcat-thread-2.txt\" &amp;\ntimeout \/t 15 \/nobreak >nul &amp;\n\njcmd 33380 Thread.print > \"%USERPROFILE%\\Desktop\\thread-dumps\\tomcat-thread-3.txt\" &amp;\ntimeout \/t 15 \/nobreak >nul &amp;\n\njcmd 33380 Thread.print > \"%USERPROFILE%\\Desktop\\thread-dumps\\tomcat-thread-4.txt\" <\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The command will create files such as:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>tomcat-thread-1.txt<\/li>\n\n\n\n<li>tomcat-thread-2.txt<\/li>\n\n\n\n<li>tomcat-thread-3.txt<\/li>\n\n\n\n<li>tomcat-thread-4.txt<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">A new dump is captured, followed by a 15-second wait before the next capture. Leave the command running for the 1-minute period which you are investigating.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">5. What to Look for in the Thread Dumps<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The main value comes from comparing several dumps taken during the same period of poor performance. Look for threads that repeatedly appear in the same state and at the same point in the stack trace.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Tomcat request threads<\/strong> that remain in the same application code or servlet across multiple dumps.<\/li>\n\n\n\n<li><strong>Database activity<\/strong> where multiple request threads remain inside JDBC calls or SQL execution.<\/li>\n\n\n\n<li><strong>Connection pool waits<\/strong> where threads repeatedly wait while attempting to borrow or obtain a database connection.<\/li>\n\n\n\n<li><strong>BLOCKED threads<\/strong> waiting to acquire the same Java monitor or lock.<\/li>\n\n\n\n<li><strong>RUNNABLE threads<\/strong> that repeatedly remain in the same CPU-intensive method or operation.<\/li>\n\n\n\n<li><strong>WAITING or TIMED_WAITING threads<\/strong> that may indicate a resource wait. These states are not automatically a problem, so the stack trace and repeated behavior matter.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon\">Alternatively, you may have the staff at mrc help you analyze the activity by reaching out to support@mrc-productivity, or specifically attaching these to your helpdesk ticket from the <a href=\"https:\/\/mrc-productivity.com\/mrcjava\/servlet\/CUSTPORTAL.I00001s\">m-Power Customer Portal<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why Multiple Dumps Matter<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A thread that happens to be executing a SQL statement or application method in one dump may be completely normal. However, if the same thread or many Tomcat request threads remain at the same point across several dumps, that is much stronger evidence of a bottleneck.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, if several consecutive dumps show a large number of Tomcat executor threads waiting for database connections, the connection pool may be exhausted or database requests may be taking long enough that connections are not being returned quickly enough. If the same request threads repeatedly remain inside JDBC or a specific SQL operation, the database query or downstream database activity becomes a stronger area to investigate.<\/p>\n\n\n\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon\">The goal is not simply to find WAITING or BLOCKED threads. The goal is to identify a repeated pattern across multiple dumps that corresponds with the time users are experiencing slow performance.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This techblog post explains how to capture Java thread dumps from a running Tomcat JVM at 15-second intervals. The purpose is to collect a series of snapshots during peak load of your m-Power environment, so you can identify threads, requests, database calls, or other activity that may be repeatedly stalled&#8230;<\/p>\n","protected":false},"author":12,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[],"ht-kb-tag":[],"class_list":["post-12674","ht_kb","type-ht_kb","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/www.mrc-productivity.com\/techblog\/index.php?rest_route=\/wp\/v2\/ht-kb\/12674","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mrc-productivity.com\/techblog\/index.php?rest_route=\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/www.mrc-productivity.com\/techblog\/index.php?rest_route=\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/techblog\/index.php?rest_route=\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/techblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=12674"}],"version-history":[{"count":5,"href":"https:\/\/www.mrc-productivity.com\/techblog\/index.php?rest_route=\/wp\/v2\/ht-kb\/12674\/revisions"}],"predecessor-version":[{"id":12681,"href":"https:\/\/www.mrc-productivity.com\/techblog\/index.php?rest_route=\/wp\/v2\/ht-kb\/12674\/revisions\/12681"}],"wp:attachment":[{"href":"https:\/\/www.mrc-productivity.com\/techblog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=12674"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/techblog\/index.php?rest_route=%2Fwp%2Fv2%2Fht-kb-category&post=12674"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/techblog\/index.php?rest_route=%2Fwp%2Fv2%2Fht-kb-tag&post=12674"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}