{"id":2113,"date":"2012-04-09T11:27:31","date_gmt":"2012-04-09T16:27:31","guid":{"rendered":"http:\/\/appcrawler.com\/wordpress\/?p=2113"},"modified":"2013-04-19T19:38:10","modified_gmt":"2013-04-20T00:38:10","slug":"print-thread-dump-for-single-thread","status":"publish","type":"post","link":"http:\/\/appcrawler.com\/wordpress\/2012\/04\/09\/print-thread-dump-for-single-thread\/","title":{"rendered":"Print thread dump for a single thread"},"content":{"rendered":"<p>We had an issue where a single thread was using all the CPU.  We wanted to check it at the command line while troubleshooting.  We  used what is below&#8230;<\/p>\n<pre lang=\"text\">\r\n[atg@CMHLDECOMAP01 ~]$ jstack 3000 | awk '{if ($1 == \"\\\"Thread-9\\\"\") {i = 1;print $0} else if (i == 1 && $0 != \"\") {print $0} else if (i == 1 && $0 == \"\") {exit}}'\r\n\"Thread-9\" daemon prio=10 tid=0x000000000c849800 nid=0xbd7 runnable [0x0000000041595000]\r\n   java.lang.Thread.State: RUNNABLE\r\n        at org.apache.log4j.Category.getEffectiveLevel(Category.java:439)\r\n        at org.apache.log4j.Category.isDebugEnabled(Category.java:733)\r\n        at com.arjuna.common.internal.util.logging.jakarta.Log4JLogger.isDebugEnabled(Log4JLogger.java:317)\r\n        at com.arjuna.common.internal.util.logging.jakarta.JakartaRelevelingLogger.isDebugEnabled(JakartaRelevelingLogger.java:73)\r\n        at com.arjuna.common.internal.util.logging.LogNoi18nImpl.isDebugEnabled(LogNoi18nImpl.java:108)\r\n        at com.arjuna.ats.arjuna.coordinator.TransactionReaper.check(TransactionReaper.java:169)\r\n        at com.arjuna.ats.internal.arjuna.coordinator.ReaperThread.run(ReaperThread.java:122)\r\n[atg@CMHLDECOMAP01 ~]$\r\n<\/pre>\n<p>This will print the call stack of that given thread, and that given thread only.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We had an issue where a single thread was using all the CPU. We wanted to check it at the command line while troubleshooting. We used what is below&#8230; [atg@CMHLDECOMAP01 ~]$ jstack 3000 | awk &#8216;{if ($1 == &#8220;\\&#8221;Thread-9\\&#8221;&#8221;) {i&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"http:\/\/appcrawler.com\/wordpress\/2012\/04\/09\/print-thread-dump-for-single-thread\/\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"footnotes":""},"categories":[25,28,27],"tags":[],"_links":{"self":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/2113"}],"collection":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/comments?post=2113"}],"version-history":[{"count":10,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/2113\/revisions"}],"predecessor-version":[{"id":2743,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/2113\/revisions\/2743"}],"wp:attachment":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/media?parent=2113"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/categories?post=2113"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/tags?post=2113"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}