App-Specific Testing | Memory and CPU

Source: Internet
Author: User

Command:

adb shell Dumpsys meminfo packagename

Focus Point:

Heap Information for 1.native/dalvik

Specifically in the first and second lines above, it gives the JNI layer and the Java layer of memory allocation, if it is found that the value has been increasing, the representative of the program may have a memory leak.

PSS Information for 2.Total

This value is the amount of memory your app really occupies, and with this information, you can easily identify which programs in your phone are more memory-heavy.

Pss:app the actual memory occupied by the app (the app itself occupies memory and shared memory)

Heap Size: The total amount of memory required to apply

Memory leaks:

A memory leak is a memory that is dynamically allocated in the middle of the program, but does not release the memory at the end of the program, causing that portion of memory to be unavailable. Causes the system to run slower or the application crashes.

Detection method: Can observe the command adb shell Dumpsys meminfo packagename Observation heap information or open DDMS, monitoring the totalsize value in the heap

Cause: Use mat to locate memory leak reason (http://blog.csdn.net/u011649536/article/details/50817454)

CPU command:

ADB Shell Top

App-Specific Testing | Memory and CPU

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.