How to get the memory/cpu information of the Android phone

Source: Internet
Author: User


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

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.