Upload
infinum
View
35
Download
0
Embed Size (px)
Citation preview
Memory profilingIvan Kocijan
If you are an Android developer you probably hate this error:
java.lang.OutOfMemoryError
This error occurs due to various reasons but luckily there are tools for detecting and reducing memory leaks.
DDMS
MAT
• MAT analyzes java heap dumps • DDMS creates an Android heap dump • To convert Android heap dump to Java we can use a tool called hprof. It comes with Android SDK and it’s used like this:
hprof-conv android.hprof java.hprof
With DDMS and MAT we can easily detect and stop memory leaks. By reducing memory leaks we can make our application work a lot better and faster but think before you do this. It takes time and at the end you might not get the desired result.
References:
• http://www.eclipse.org/mat/ • http://developer.android.com/tools/debugging/ddms.html