{"id":880,"date":"2011-10-31T23:14:11","date_gmt":"2011-11-01T06:14:11","guid":{"rendered":"http:\/\/wiebe-elsinga.com\/blog\/?p=880"},"modified":"2011-11-01T01:30:49","modified_gmt":"2011-11-01T08:30:49","slug":"android-best-practices-mat","status":"publish","type":"post","link":"http:\/\/wiebe-elsinga.com\/blog\/android-best-practices-mat\/","title":{"rendered":"Android Best Practices: MAT"},"content":{"rendered":"<div class=\"wpsso-pinterest-pin-it-image\" style=\"display:none !important;\">\n<\/div><!-- .wpsso-pinterest-pin-it-image -->\n\n<p>When you want to improve an Android application performance, you need to do profiling. Welcome MAT!<\/p>\n<h3>What is MAT?<\/h3>\n<p>It&#8217;s a Java heap analyzer tool introduced by Eclipse that helps you find memory leaks.<\/p>\n<h3>How-To<\/h3>\n<p>First you need to extract a hprof file from the Android device. When running the device select the <em>Dump HPROF file<\/em> option as shown here<\/p>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-886\" title=\"get dump\" src=\"http:\/\/wiebe-elsinga.com\/blog\/wp-content\/uploads\/2011\/10\/get-dump.png\" alt=\"\" width=\"258\" height=\"26\" \/><\/p>\n<p>Convert the <em>.hprof<\/em> file from the Dalvik format to the J2SE HPROF format. You can do this using the hprof-conv tool provided in the Android SDK.<\/p>\n<div class=\"codecolorer-container bash default\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><div class=\"bash codecolorer\">hprof-conv dump.hprof converted-dump.hprof<\/div><\/div>\n<p>Import the converted <em>hprof<\/em> file into MAT, and start anaylzing<\/p>\n<p><a href=\"http:\/\/wiebe-elsinga.com\/blog\/wp-content\/uploads\/2011\/10\/example-MAT.png\"><img loading=\"lazy\" class=\"aligncenter size-medium wp-image-890\" title=\"example MAT\" src=\"http:\/\/wiebe-elsinga.com\/blog\/wp-content\/uploads\/2011\/10\/example-MAT-300x236.png\" alt=\"\" width=\"300\" height=\"236\" srcset=\"http:\/\/wiebe-elsinga.com\/blog\/wp-content\/uploads\/2011\/10\/example-MAT-300x237.png 300w, http:\/\/wiebe-elsinga.com\/blog\/wp-content\/uploads\/2011\/10\/example-MAT-800x632.png 800w, http:\/\/wiebe-elsinga.com\/blog\/wp-content\/uploads\/2011\/10\/example-MAT.png 847w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>When you want to improve an Android application performance, you need to do profiling. Welcome MAT! What is MAT? It&#8217;s a Java heap analyzer tool introduced by Eclipse that helps you find memory leaks. How-To First you need to extract a hprof file from the Android device. When running the device select the Dump HPROF file option as shown here Convert the .hprof file from the Dalvik format to the J2SE HPROF format. You can do this using the hprof-conv tool provided in the Android SDK. hprof-conv dump.hprof converted-dump.hprof Import the converted hprof file into MAT, and start anaylzing<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[7],"tags":[154,98,102],"_links":{"self":[{"href":"http:\/\/wiebe-elsinga.com\/blog\/wp-json\/wp\/v2\/posts\/880"}],"collection":[{"href":"http:\/\/wiebe-elsinga.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/wiebe-elsinga.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/wiebe-elsinga.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/wiebe-elsinga.com\/blog\/wp-json\/wp\/v2\/comments?post=880"}],"version-history":[{"count":0,"href":"http:\/\/wiebe-elsinga.com\/blog\/wp-json\/wp\/v2\/posts\/880\/revisions"}],"wp:attachment":[{"href":"http:\/\/wiebe-elsinga.com\/blog\/wp-json\/wp\/v2\/media?parent=880"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/wiebe-elsinga.com\/blog\/wp-json\/wp\/v2\/categories?post=880"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/wiebe-elsinga.com\/blog\/wp-json\/wp\/v2\/tags?post=880"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}