Im determining the size that a bitmap will take in memory using the following method:
bitmapOptions.inJustDecodeBounds = true;
BitmapFactory.decodeFile(imagePath, bitmapOptions);
long bitmapSizeInMB = (bitmapOptions.outWidth * bitmapOptions.outHeight * 4) / 1048576L);
bitmapOptions.inJustDecodeBounds = false;
And the result, for example, is 5MB
But what happens is, the moment I decode the bitmap using
bitmap = BitmapFactory.decodeFile(imagePath, bitmapOptions);
and set it to an imageview, the GC system message in Logcat says RAM usage has increased by 20 MB, not 5.
So my question is, by doing this bitmap size check operation, do I increase the RAM usage?