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