开发者

Loading a bitmap takes more memory of the bitmap itself

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜