Memory pressure from large images
You need to show a single 50MB photo on screen. If you just load it with UIImage(contentsOfFile:), how much memory does it take?
You need to show a single 50MB photo on screen. If you just load it with UIImage(contentsOfFile:), how much memory does it take?
Memory use is set by the decoded size, width times height in pixels at 4 bytes per pixel, not the file size. A 12000×9000 photo turns a 50MB file into about 432MB, enough for one image to push the app past its memory limit and get it killed.
Performance and debuggingShort answerAdvanced
A photo editing app gets frequent memory warnings and sometimes gets killed. In what…
#image #downsampling #memory #nscache
Performance and debuggingShort answerAdvanced
An iOS feature that edits and saves photos of tens of MB gets killed after a memory…
#downsampling #imageio #memory
iOS system designMultiple choiceIntro
You show 60 thumbnails of 4000×3000 JPEGs in a 3-column grid and memory jumps to several…
#image #downsampling #memory
Performance and debuggingMultiple choiceBasics
You decode a 100×100 pixel RGBA PNG (3KB on disk) to draw it on screen. Which value is…
#image #memory