Calling procrank doesn't work on real devices
Asked Answered
W

4

8

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?

Waterproof answered 6/7, 2012 at 7:11 Comment(1)
the question means this part of the session youtu.be/gbQb1PVjfqM?t=558Vishinsky
B
4

You can use dumpsys command

Steps:

  1. issue command line: dumpsys meminfo packageName
  2. The Private Dirty column is you wanted.
Bailsman answered 4/9, 2012 at 13:38 Comment(2)
are you sure ? is it exactly the same ? i mean , is it really the value which says : "the amount of bytes that will be freed when the process of this app will be killed" ?Waterproof
what's the differents of procrank and dumpsysUnderside
U
2

U can also use

adb shell dumpsys meminfo

or

adb shell dumpsys meminfo  + pid

command

Underside answered 28/4, 2013 at 3:38 Comment(1)
are you sure ? is it exactly the same ? i mean , is it really the value which says : "the amount of bytes that will be freed when the process of this app will be killed" ?Waterproof
C
1

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

is same as

procrank (USS)

Chopper answered 25/2, 2015 at 13:57 Comment(3)
Can you show some reference that says that it's the same?Waterproof
I checked the actual output of both the commands to conclude that. Also some scattered references on web here The Uss refers to the private pages of a process, which can be further exclusively divided into PrCl(clean ones) and PrDi(dirty ones) and here The important details are the memory used by USS (Private Dirty + Private Clean) and PSS totalChopper
Another reference can be found in this [stackexchange-question] (unix.stackexchange.com/questions/33381/…) USS isn't reported in smaps, but indeed, it is the sum of private mappings.Chopper
S
-1

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
Spavin answered 26/7, 2016 at 11:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.