Memory Leak Detection

1. Static analysis tools -Lint check for memory leaks

Android Studio own tools, use Analyze - "Inspect Code and then select the desired scan area of ​​the surface

 

2.LeakCanary Tools

 

3.Android Monitor

 

The difference between memory overflows and memory leaks

Out of memory out of memory, refers to the program at the time of application memory, there is not enough memory space for its use, appear out of memory; for example, apply for an integer, but to save it in order to save enough for a few long, and that is out of memory .

Memory leak memory leak, refers to the program after the application memory to free up memory space has been filed, a memory leak hazards can be ignored, but the accumulation of memory leaks very serious consequences, no matter how much memory, sooner or later occupied light.

Guess you like

Origin www.cnblogs.com/acg88688/p/11870578.html