CGImageSourceCreateThumbnailAtIndex Uses Extreme Amounts of Memory on iPhone 4s with iOS 7
| Originator: | bryn.bodayle | ||
| Number: | rdar://15540308 | Date Originated: | 11/22/13 |
| Status: | Open | Resolved: | |
| Product: | iPhone 4s | Product Version: | |
| Classification: | Serious Bug | Reproducible: | always |
Summary: I am trying to use the ImageIO method CGImageSourceCreateThumbnailAtIndex to resize a large image in a memory efficient way. In previous versions of iOS, this method proved to be memory efficient. Now on iOS 7 with the iPhone 4s, the CGImageSourceCreateThumbnailAtIndex method takes upwards of 40MB of memory. I've attached Steps to Reproduce: I've attached logs and sample project which will show the problem on the iPhone 4s with any version of iOS 7. 1. Build and run the sample project on an iPhone 4s with iOS 7.x. 2. Switch to the memory debug gauges. 3. Take a photo using the rear facing camera on the iPhone 4s. 4. Press the "Use Photo" button and watch as the memory spikes up 40+ MB. Expected Results: On the iPhone 5s and other devices, this method uses a significant less amount of memory, more like 3-MB. Actual Results: On the iPhone 4s, the method uses 40+ MB of memory. Version: iOS 7.0.4 and iOS 7.1 Notes: I'm looking for a memory efficient way to crop and resize a large image from the camera roll. I have tried this method with various other configurations. It did work, but doesn't now. I've used the method detail on this blog post and have had no luck. http://mindsea.com/2012/12/18/downscaling-huge-alassets-without-fear-of-sigkill/ Thanks so much! Configuration: This always occurs on the iPhone 4s with iOS 7. The issue does not seem to be present on the iPhone 4s with iOS 6 and older versions. The iPhone 5 and iPhone 5s on iOS 7 do not show the same memory spikes. Sample Project and Screenshots: https://www.dropbox.com/s/pkpbx6l9lgnjl1s/CGImageSourceCreateThumbnailAtIndex%20Issue.zip
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!