{"id":43,"date":"2008-08-20T08:52:50","date_gmt":"2008-08-20T07:52:50","guid":{"rendered":"http:\/\/hirt.se\/blog\/?p=43"},"modified":"2010-02-02T22:28:31","modified_gmt":"2010-02-02T21:28:31","slug":"getting-jrockit-stack-dumps","status":"publish","type":"post","link":"https:\/\/hirt.se\/blog\/?p=43","title":{"rendered":"Getting JRockit Stack Dumps"},"content":{"rendered":"<p>Sometimes it may seem hard to get a simple thread stack dump from your JRockit. You may for instance have started it using the <a href=\"http:\/\/e-docs.bea.com\/jrockit\/jrdocs\/refman\/optionX.html#wp999532\">-Xnohup<\/a> (-Xrs) option, or as a service. I&#8217;ll list three different ways of looking at your threads in such situations.<\/p>\n<p>The first way of getting your thread dump is to use <strong>jrcmd<\/strong>. My <a href=\"http:\/\/blogs.oracle.com\/hirt\/2008\/08\/simple_exception_profiling_wit.html\">previous blog<\/a> shows some basic <strong>jrcmd <\/strong>usage, so I&#8217;ll just mention the command name: <strong>print_threads<\/strong>. Basic usage is <strong>jrcmd &lt;PID&gt; print_threads<\/strong>, for example <strong>jrcmd 780 print_threads.<\/strong><\/p>\n<p>The second way is to simply start the management console on the JRockit you want to monitor. After connecting the console to the JVM and switching to the threads view, you should be looking at something similar to the screen shot below.<\/p>\n<p><a href=\"https:\/\/hirt.se\/blog\/wp-content\/uploads\/2008\/08\/thread-dumps.png\"><img loading=\"lazy\" decoding=\"async\" height=\"434\" alt=\"thread_dumps\" src=\"https:\/\/hirt.se\/blog\/wp-content\/uploads\/2008\/08\/thread-dumps-thumb.png\" width=\"644\" border=\"0\" \/><\/a> <\/p>\n<p>The third way is to use the MBean Browser&#8217;s capability to invoke arbitrary operations on MBeans (also described in the last blog). Go to the<strong> MBean Browser<\/strong> in the JRockit Management Console. Select the <strong>DiagnosticCommand <\/strong>MBean, and switch to the operations tab. Select the <strong>execute <\/strong>operation that takes a String argument and returns a String. Click the String button, and fill in the argument <strong>print_threads<\/strong>. <\/p>\n<p><a href=\"https:\/\/hirt.se\/blog\/wp-content\/uploads\/2008\/08\/invoking-dc.png\"><img loading=\"lazy\" decoding=\"async\" height=\"434\" alt=\"invoking_dc\" src=\"https:\/\/hirt.se\/blog\/wp-content\/uploads\/2008\/08\/invoking-dc-thumb.png\" width=\"644\" border=\"0\" \/><\/a> <\/p>\n<p>When you execute the operation you should see something like this:<\/p>\n<p><a href=\"https:\/\/hirt.se\/blog\/wp-content\/uploads\/2008\/08\/after-dc.png\"><img loading=\"lazy\" decoding=\"async\" height=\"434\" alt=\"after_dc\" src=\"https:\/\/hirt.se\/blog\/wp-content\/uploads\/2008\/08\/after-dc-thumb.png\" width=\"644\" border=\"0\" \/><\/a> <\/p>\n<p>There are also ways of doing this programmatically, for example by using the <a href=\"http:\/\/e-docs.bea.com\/jrockit\/releases\/R27\/javadoc\/manapi\/docs\/index.html\">JRockit JMAPI<\/a>, or by invoking the execute operation programmatically as described in <a href=\"http:\/\/blogs.oracle.com\/hirt\/2008\/08\/jrcmd_goes_remote_r271_edition.html\">another old blog<\/a>. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes it may seem hard to get a simple thread stack dump from your JRockit. You may for instance have started it using the -Xnohup (-Xrs) option, or as a service. I&#8217;ll list three different ways of looking at your threads in such situations. The first way of getting your thread dump is to use [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-43","post","type-post","status-publish","format-standard","hentry","category-java-mission-control-fair-dj"],"_links":{"self":[{"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/43","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=43"}],"version-history":[{"count":1,"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/43\/revisions"}],"predecessor-version":[{"id":80,"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/43\/revisions\/80"}],"wp:attachment":[{"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=43"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=43"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=43"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}