artem
artem

Reputation: 16777

Get other app's memory class

getMemoryClass() and getLargeMemoryClass() return memory class for the calling application. Is it possible to get memory class of the another running process?

Upvotes: 2

Views: 165

Answers (1)

kabuko
kabuko

Reputation: 36302

If you read the documentation for getMemoryClass it says:

Return the approximate per-application memory class of the current device.

It's the same for any application. It's the memory class of the current device.

To detect whether an application is using the large heap option or not, try using PackageManager.getApplicationInfo. You should be able to read the flags field for FLAG_LARGE_HEAP. I think it'll work anyway; the flags documentation doesn't include it, but the FLAG_LARGE_HEAP doc references flags.

Upvotes: 2

Related Questions