title: UIImage Memory Problems
body: <p>In my app I am returned from an API the urls of images, which I want to display in the app. This is all well and good, except I started to notice that when I am given, and load, very high-res images my app memory usage spikes 200+mb, often causing it to crash, which is unacceptable.</p>
  
  <p>In one particular example, I am given an image that is of the dimensions 8100*5400 pixels. When the app loaded this image it crashed.</p>
  
  <p>While I first thought the problem was a memory leak I created, but after doing some research, it seems like an unavoidable issue related to the size of the image -- since the image is 43,740,000 pixels and each pixel uses 4 bytes, the memory usage of the image will be a minimum of 174,960,000 bytes, or 174.96 megabytes.</p>
  
  <p>The problem is i cannot control the size of the images sent by the api - they may be any resolution, possibly even larger. Obviously a <code>UIImage</code> will not work for my purposes. </p>
  
  <p>Is there any other way I can display an image with a potentially massive resolution without causing app-crashing memory usage?</p>