开发者

Loading a bitmap takes more memory of the bitmap itself

开发者 https://www.devze.com 2023-04-05 05:12 出处:网络
I\'m loading a 489KB bitmap using the BitmapFactory.decodeFile. and I check how much memory my program takes after lo开发者_如何学Cading it and I see it adds ~5000KB

I'm loading a 489KB bitmap using the BitmapFactory.decodeFile.

and I check how much memory my program takes after lo开发者_如何学Cading it and I see it adds ~5000KB

why is that, and what should I do to avoid it?


Your bitmap is file is most likely compressed (PNG/JPG). You can't expect that loaded bitmap will be still compressed in memory. Each decompressed pixel in memory takes usually 4 bytes.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号