Calling procrank doesn't work on real devices

7.1k views Asked by At

according to a google io video about getting to know how much memory you app takes , you can use procrank and read the USS value of it.

i've tried it out on emulators (no matter which version i use - from 2.3.x to 4.1) and it works well , but running on an actual device , it didn't work (tested on galaxy s3 with android 4.0.4) . it's as if the command doesn't exist .

how could it be ? is there an alternative to get this USS value?

4

There are 4 answers

2
Nigel Ding On

You can use dumpsys command

Steps:

  1. issue command line: dumpsys meminfo packageName
  2. The Private Dirty column is you wanted.
1
Hugo On

U can also use

adb shell dumpsys meminfo

or

adb shell dumpsys meminfo  + pid

command

3
neel On

adb shell dumpsys meminfo [pid] (Private Dirty + Private Clean)

is same as

procrank (USS)

0
henryyexm On

procrank and dumpsys meminfo is not the same command, because procrank can show more thread which is killed by accident.

First you shell get procrank, procmem, libpagemap.so from Google

Then do push like :

adb push procrank /system/xbin 
adb push procmem /system/xbin 
adb push libpagemap.so /system/lib

Last :

adb shell chmod 6755 /system/xbin/procrank 
adb shell chmod 6755 /system/xbin/procmem 
adb shell chmod 6755 /system/lib/libpagemap.so