2. ● What is memory leak?
● Tools : MAT(Eclipse Memory Analyzer)
● How to detect Memory leak in Android
3. “App expands to fill the memory available”
- From Dinesh Prajapati
4. What is Memory Leak?
loss of available memory when a program fails to return memory that it has obtained for
temporary use
A constantly increasing memory usage is not necessarily evidence of a memory leak
Garbage Collection
Stack vs Heap Memory
5. Visual
Reference objects but not exactly used
Not considered as Unreferenced objects
GC can not happen
Stays in memory for longer
6. MAT
The Eclipse Memory Analyser Tooling
(MAT) is a set of plug-ins for the
Eclipse IDE which provides tools to
analyze heap dumps from Java
application and to identify memory
problems in the application. This helps
the developer to find memory leaks
and high memory consumption issues.
It visualizes the references to objects
based on Java heap dumps and
provides tools to identify potential
memory leaks.
7. http://eclipse.org/mat
Shallow Heap and Retained Heap
Dominator tree
Histogram
Memory Leaks
● Reference to activity,Context,View,Drawable,...
● Non-static inner class
● Caches