I have an application in which i am using lots of images but i have found an abnormal issue with the application memory footprints. I am using imageNamed
method to initialise UIImage
objects. From the documentation i have read that imageNamed
keeps the memory in cache and does not reload the images every time. This works for me because my application is based on images only but in my case it seems that each time my application is moved from background
to foreground
the images are loaded again. This i feel because when i did memory profiling for the application in each generation whenever i moved from background to foreground the amount of memory consumed increased tremendously in VM:ImageIO_PNG_DATA
and ultimately my application crashed as it was consuming more than 600 MB. At some places i read that we should use imageWithContentsOfFile
to avoid this issue but I am not sure that whether this is a right approach or not.
Please guide me regarding the same.