I’m tracking memory leaks on my iOS application and I have a weird leak that makes my application crashed …
The responsible frame is : CGImageMergeXMPPropsWhithLegacyProps.
At some point my app received a memory warning …
I’m creating UIImage from ALAsset like this :
ALAsset *asset = [assetsArray objectAtIndex:index];
UIImage *image = [UIImage imageWithCGImage:[[asset defaultRepresentation] fullScreenImage]];
Do you have an idea how to solve this ?
Hope this help.
I also use the ALAsset, and I encountered memory warning. I’m still searching my solution for my app… The crash may be because iOS dealloc your view or objects because of memory warning. So, maybe preventing from memory warning is important. Keep peak memory low to bellow 30MB. I encountered memory warning for 50MB for ipad2 and didn’t get it from iphone4. Anyway, lower is the better.
First of all,you can measure the memory
by using instrument or the following code. It’s easier measure memory in code for logging.
1. register a timer for repeatedly report memory usage, you can see the peak memory usage in this way.
On other hand, I have no idea why this function will increase memory graduately.
2. “iPhone Programming The Big Nerd Ranch Guide” book said iOS may have 24MB for graphical memory
“Overuse of graphical memory is typically the reason why an application receives a low-memory warning. Apple suggests that you don’t use more than 24 MB of graphics memory. For an image the
size of the iPhone screen, the amount of memory used is over half a megabyte. Each UIView, image, Core Animation layer, and anything else that can be displayed on the screen consumes some of the allotted 24 MB. (Apple doesn’t suggest any maximum for other types of data like NSStrings.)”
So, review graphical memory usage.