views:

85

answers:

1

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.

+1  A: 

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?

OgreSwamp
lost amongst all the images, I was using huge dimensions. solved it now. thanks a LOT>
alJaree
There's a function to compute the size of UIImage in memory [located here](http://stackoverflow.com/questions/2921560/memory-troubles-with-uiimagepicker/2921725#2921725). That might be useful next time.
progrmr