java - Detecting Memory and CPU consumption of a particluar app -


i want detect memory , cpu consumption of particular app in android (programmatically), can 1 me it. have tried top method, want alternative it.

any appreciated, :)

if wan trace memory usage in app there activitymanager.getmemoryinfo() api.

cpu usage can traced using cpustatscollector api.

for more informative memory usage overview, outside app, can use adb shell dumpsys meminfo <package_name|pid> [-d] more specific memory usage statistics. example, there the command com.google.android.apps.maps process:

adb shell dumpsys meminfo com.google.android.apps.maps -d

which gives following output:

** meminfo in pid 18227 [com.google.android.apps.maps] **                pss  private  private  swapped     heap     heap     heap              total    dirty    clean    dirty     size    alloc     free             ------   ------   ------   ------   ------   ------   ------ native heap    10468    10408        0        0    20480    14462     6017 dalvik heap    34340    33816        0        0    62436    53883     8553 dalvik other      972      972        0        0     stack     1144     1144        0        0   gfx dev    35300    35300        0        0 other dev        5        0        4        0  .so mmap     1943      504      188        0  .apk mmap      598        0      136        0  .ttf mmap      134        0       68        0  .dex mmap     3908        0     3904        0  .oat mmap     1344        0       56        0  .art mmap     2037     1784       28        0 other mmap       30        4        0        0 egl mtrack    73072    73072        0        0 gl mtrack    51044    51044        0        0   unknown      185      184        0        0     total   216524   208232     4384        0    82916    68345    14570 

(output trimmed) more here

tracing of memory usage on modern operating systems complex task. see question more info.


Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -