First, monitoring operation steps
1. Open Eclipse, switch to DDMS mode, connect the device, turn on USB debugging,
2, in the devices bar will display the connected device, select the package name to monitor
3. Click Update Heap in Devices view
4. Click Gause GC in the heap view,
Second, to determine the memory leaks
in the middle of the heap view, there is a type called data object, which is an object of the class type that exists in our program. In the data object row, there is a column "total size", whose value is the amount of memory for all Java data Objects in the current process, in general, the size of this value determines whether there is a memory leak. It can be judged as follows:
1. Enter an application, continue to operate the application, while observing the total size value of the data object
2. Under normal circumstances, the total size value will stabilize within a limited range.
3. Conversely, if an object reference is not released in the code, the total size value of the data object does not come down significantly after each GC, and as the number of operations is increased, the value of total size is increased until an upper limit is reached, causing the process to be killed.
In our program, if there is a There is a growing phenomenon in a process, and there may be a problem with the application leaking . If a process crashes during an operation, the application may have requested no space and there may be a memory leak.
Android memory leak/Process memory Check--DDMS tool