{"id":198,"date":"2008-01-20T12:20:26","date_gmt":"2008-01-20T12:20:26","guid":{"rendered":"https:\/\/kari.world.ikari.fi\/2008\/01\/20\/java-se-6-troubleshooting\/"},"modified":"2008-01-20T12:20:26","modified_gmt":"2008-01-20T12:20:26","slug":"java-se-6-troubleshooting","status":"publish","type":"post","link":"https:\/\/kari.world.ikari.fi\/?p=198","title":{"rendered":"Java SE 6 troubleshooting"},"content":{"rendered":"<p>Some interesting additional java parameters: <a href=\"http:\/\/java.sun.com\/javase\/6\/webnotes\/trouble\/TSG-VM\/html\/gdaog.html\">B.1 HotSpot VM Command-Line Options &#8211; Troubleshooting Guide for Java SE 6 with HotSpot VM<\/a><\/p>\n<p>Option to automatically make memory dump when OutOfMemory occurs sounds rather interesting.<\/p>\n<p>These utilities, should exist in all java deployments:<\/p>\n<ul>\n<li><b>jps<\/b>: List PIDs of java processes<\/li>\n<li><b>jmap<\/b>: Make heap of java process (jmap -dump:format=b,file=test.hprof PID)<\/li>\n<li><b>jinfo<\/b>: Modify &#8221;-X&#8221; and &#8221;-XX&#8221; flags <strong>on-the-fly<\/strong> in java process<\/li>\n<li><b>jstack<\/b>: Get stack trace of java process<\/li>\n<\/ul>\n<p><b>PS.<\/b> According to one source, <a href=\"http:\/\/blogs.sun.com\/jonthecollector\/entry\/did_you_know\">&#8221;Huge methods (8000 bytes of bytecode) are not JIT compiled with HotSpot.&#8221;<\/a>, this indicates that huge methods really must be avoided. So if you&#8217;ve habit of writing very length methods, there is <b>two<\/b> reasons to get rid off such habit:<\/p>\n<ol>\n<li>Code maintainability and readability. Making smaller methods makes analysis of the code much easier for fellow developers. Also it opens paths for otherwise unseen optimization, code reuse, etc. possibilities.<\/li>\n<li>Allowing Java JIT to perform its&#8217; task<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Some interesting additional java parameters: B.1 HotSpot VM Command-Line Options &#8211; Troubleshooting Guide for Java SE 6 with HotSpot VM Option to automatically make memory dump when OutOfMemory occurs sounds rather interesting. These utilities, should exist in all java deployments: jps: List PIDs of java processes jmap: Make heap of java process (jmap -dump:format=b,file=test.hprof PID)&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-198","post","type-post","status-publish","format-standard","hentry","category-java"],"_links":{"self":[{"href":"https:\/\/kari.world.ikari.fi\/index.php?rest_route=\/wp\/v2\/posts\/198","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kari.world.ikari.fi\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kari.world.ikari.fi\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kari.world.ikari.fi\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kari.world.ikari.fi\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=198"}],"version-history":[{"count":0,"href":"https:\/\/kari.world.ikari.fi\/index.php?rest_route=\/wp\/v2\/posts\/198\/revisions"}],"wp:attachment":[{"href":"https:\/\/kari.world.ikari.fi\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=198"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kari.world.ikari.fi\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=198"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kari.world.ikari.fi\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=198"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}