Occasionally to dump some of the phone's memory, CPU information, see for themselves or to provide information to Rd, so for Android some basic adb command or familiar.
To view memory with commands:
1, Top
2, PS
3, Procrank
4, Dumpsys Meminfo
All four commands are shell commands, so if running directly requires the ADB shell. Embedding programs, if you use Ddmlib to drive them, you can use Idevice.executeshellcommand (command).
After you enter these commands, you will find that the results are all processes ... A sentence to see is a very troublesome thing. So we need to use some methods to deal with ...
The shell of the Android phone was previously said to be half a cripple, and some useful commands are not supported, except for the grep to be used this time. Add package name after the above four commands, for example
Procrank Com.tencent.mobileqq, you can filter out all the data that contains this field.
As for why there are four orders, because of their division of labor and use of different occasions.
The first two commands can only trace the VSS RSS memory footprint, and the following two commands detect the PSS USS Memory footprint.
Dumpsys Meminfo can find out how much memory native and Dalvik occupy, Dumpsys used to give information about all the applications in the phone, and also to the status of the phone.
Vss-virtual Set Size Virtual consumption memory (contains memory occupied by shared libraries)
Rss-resident Set Size actually uses physical memory (contains memory occupied by shared libraries)
Pss-proportional the physical memory that Set Size actually uses (proportional allocation of memory occupied by shared libraries)
Uss-unique the physical memory occupied by the Set Size process alone (does not contain memory occupied by shared libraries)
Generally speaking, the memory footprint has the following regularity: VSS >= RSS >= PSS >= USS
Report:
Dumpsys [Option]
Option can be:
Dumpsysmeminfo Display Memory Information
Cpuinfo Display CPU Information
Account Display accounts information
The activity shows all the activities information
window displays the keyboard, the windows, and their relationships
WiFi Display WiFi information