Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android memoryInfo values

I am using this block of code for determing, actual allocated memory.

    ActivityManager activityManager =  (ActivityManager) getSystemService(ACTIVITY_SERVICE);
    MemoryInfo memoryInfo = new MemoryInfo();
    activityManager.getMemoryInfo(memoryInfo);
    long one=memoryInfo.availMem;
    Log.i("memory free1", "" + memoryInfo.availMem);

While creating and asigning String[100] field, I get value 61440. Is it in bytes or kB? Documentation says nothing about it.

Thanks

like image 822
Waypoint Avatar asked Sep 15 '25 14:09

Waypoint


1 Answers

ActivityManager.MemoryInfo: availMem, totalMem, threshold are all in bytes.

like image 59
Dan Meng Avatar answered Sep 17 '25 05:09

Dan Meng