title: Watching memory usage in iOS
body: <p>Is there any way to find out how much memory is available in iOS? I know that the system will pass low memory warnings when available memory gets low. However, my App has some points where a single thread will perform a complex task and sometimes that task uses up enough memory that it is just terminated by the OS (my app can download pictures from the internet, and I scale them down to a small size ... if the user downloads a very large image, my app runs out of memory and just goes 'poof').</p>
  
  <p>Having the App spontaneously terminate is obviously a poor user experience.</p>
  
  <p>Is there any way that I can find out when I am about to run out of memory and stop the task instead?</p>
  
  <p>I suppose I could put the task on a separate thread, and maybe the system would send the main thread a low memory warning, but that seems pretty complicated and not even guaranteed to work.</p>
  
  <p>Thanks!
  Ron</p>