开发者

ImageIO causes more memory to be allocated than the size of the images

开发者 https://www.devze.com 2023-01-08 20:45 出处:网络
I have 5 UIimageViews which display .png files, each max 200kb, but ImageIO allocates around and average of 1.3 mb for each. totaling 开发者_开发问答7.3 mb for the view when loaded.

I have 5 UIimageViews which display .png files, each max 200kb, but ImageIO allocates around and average of 1.3 mb for each. totaling 开发者_开发问答7.3 mb for the view when loaded.

What is causing this to happen?

I have another class with same amount of images and that allocates only 2 mb max.


As far as I understand images are stored in memory in raw RGBA data (red, green, blue, alpha). So load you load png/jpeg (both compressed formats) iPhone uses 4 bytes per pixel. So 100x100 image will be 40000 bytes. Waht size are your images?

0

精彩评论

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