I recently ran into a memory management issue in my application.
The application takes advantage of some high-quality images, which greatly increases memory usage.
Below are some details about the project details and images to make the problem more clear:
About 90 images have been added to my project. Half of them are designed in @ 2x size to support the new Retina screen for iPad. Thus, the maximum number of images for each device is about 45.
The total size of the Retina version of all images is about 25 megabytes (the size of each individual image varies from 10 KB to 6.8 MB). Meanwhile, the size of all standard images is 11 megabytes.
The size of the Xcode project archive is 44 megabytes.
The maximum resolution of individual images in the standard version of the images is about 1500x4000 pixels, and the minimum is about 60x60 pixels.
The maximum resolution of individual images in the Retina image version is about 3000x8000 px, and the minimum is about 120x120 pixels.
The Retina version of images has the suffix "@ 2x ~ ipad" in the name, and the suffix of the name for others is "~ ipad".
Only one instance of most images is created during the application life cycle.
25 , .
[UIImage imageNamed: @ "image_name.png" ] , ( [UIImage imageWithContentsOfFile] [UIImage imageWithData] ).
:
, , . :
iPad 2 : 58
iPad 2 ( ): 131
, , ?
, , , png jpg, , . * * 4 .
-[UIImage imageNamed:] , :
-[UIImage imageNamed:]
, . , . . , - , . , , . , , . , , . , , , .
- , . , - - , (, - , , ).