{"id":3379,"date":"2015-04-09T07:42:37","date_gmt":"2015-04-09T12:42:37","guid":{"rendered":"http:\/\/appcrawler.com\/wordpress\/?p=3379"},"modified":"2015-04-09T07:42:37","modified_gmt":"2015-04-09T12:42:37","slug":"dump-heap-programatically","status":"publish","type":"post","link":"http:\/\/appcrawler.com\/wordpress\/2015\/04\/09\/dump-heap-programatically\/","title":{"rendered":"Dump heap programatically"},"content":{"rendered":"<p>This is one way you can dump the heap of a running JVM from within a page.  This is not something you would place in a running production system, as you don&#8217;t want random GET&#8217;s to keep dumping the heap to disk.  This is just another tool to add to your box for how to get things done under pressure.<\/p>\n<pre lang=\"java\">\r\n<%@page import=\"javax.management.MBeanServer\"%>\r\n<%@page import=\"java.lang.management.ManagementFactory\"%>\r\n<%@page import=\"com.sun.management.HotSpotDiagnosticMXBean\"%>\r\n\r\n<%\r\nMBeanServer server = ManagementFactory.getPlatformMBeanServer();\r\nHotSpotDiagnosticMXBean bean = ManagementFactory.newPlatformMXBeanProxy(server,\"com.sun.management:type=HotSpotDiagnostic\", HotSpotDiagnosticMXBean.class);\r\nbean.dumpHeap(\"\/u01\/app\/oracle\/Middleware\/mydump\", true);\r\n%>\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This is one way you can dump the heap of a running JVM from within a page. This is not something you would place in a running production system, as you don&#8217;t want random GET&#8217;s to keep dumping the heap&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"http:\/\/appcrawler.com\/wordpress\/2015\/04\/09\/dump-heap-programatically\/\">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":[24,25],"tags":[],"_links":{"self":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/3379"}],"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=3379"}],"version-history":[{"count":2,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/3379\/revisions"}],"predecessor-version":[{"id":4839,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/3379\/revisions\/4839"}],"wp:attachment":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/media?parent=3379"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/categories?post=3379"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/tags?post=3379"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}