8 Ways to view Android memory

Source: Internet
Author: User

Method One:

Through the activity of Running services on the phone, you cango through setting->applications-> Running services. For more information about running services, please refer to
"Running services" is used in Android to view service process memory http://hubingforever.blog.163.com/ blog/static/17104057920114201075692/

Method Two:

Getmemoryinfo (Activitymanager.memoryinfo outinfo) activitymanager.getmemoryinfo () using Activitymanager It is mainly used to get the remaining memory of the current system and to determine whether it is running in low memory.

Method Three:

Use Debug in code getmemoryinfo (Debug.memoryinfo memoryinfo) or Activitymanager memoryinfo[] Getprocessmemoryinfo (int [] PIDs)

Method Four:

Use the Getnativeheapsize (), Getnativeheapallocatedsize (), Getnativeheapfreesize () method of Debug.

Method Five:

we can run the Dumpsys meminfo command in the ADB shell to get the memory information of the process. After the command, add the name of the process to determine which process it is. such as "adb shell dumpsys meminfo com.joyodream.pingo"

Method Six:

If you want to see memory usage for all processes, you can use the "adb shell procrank" command. (Not so mobile phones are supported)

    • VSS -Virtual Set Size virtualized memory consumption (contains memory consumed by shared libraries)
    • RSS -resident Set Size actually uses physical memory (contains memory consumed by shared libraries)
    • PSS -Proportional Set Size actual physical memory used (proportional allocation of memory consumed by shared libraries)
    • USS -Unique Set Size process consumes physical memory alone (does not contain memory consumed by shared libraries)

In general, memory footprint has the following rules: VSS >= RSS >= PSS >= USS

Method Seven:

Use the "adb shell cat/proc/meminfo" command.

Method Eight:

Use the "adb shell ps-x" command

8 Ways to view Android memory

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.