2

I'm getting processname and pid using activity manager and getprocessMemoryInfo(),but how to get exact memory used by the applications,as I'm getting different memories like getTotalPrivateDirty(),getTotalPss(),getTotalSharedDirty()

All the above are not matching with any of the memory that is shown in application manager.

Anyone have any idea?

Charles
  • 50,943
  • 13
  • 104
  • 142

2 Answers2

0

As How do I discover memory usage of my application in Android? covers, there is no such thing as "exact memory usage". If you want to reproduce the algorithm that the Application Manager uses, then you could always look at its source code!

Community
  • 1
  • 1
zmarties
  • 4,809
  • 22
  • 39
0

Not sure if this is the direction you wanted but it might work well. You can use an adb command, like so:

adb shell ps m.android.phone

Also your application is the inner scope of the Android OS so trying to figure what is going outside from within will generally be harder than view the OS independently.

sivi
  • 10,654
  • 2
  • 52
  • 51