Android memory leak/Process memory Check--DDMS tool

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.