I had a memory failure in UIGraphicsGetImageFromCurrentImageContext () ... if you create and release a lot of them, you have to wrap them in a new AutoReleasePool for each iteration. Even letting NSRunLoop tick, IT IS NOT SUFFICIENT for Apple / iOS to do housekeeping on the trash lying around it.
eg.
for( ... ) { @autoreleasepool { UIImage* blah = UIGraphicsGetImageFromCurrentImageContext(); } }
source share