title: iOS: Strategies for downloading very large data from web
body: <p>I'm struggling with memory management in iOS while downloading relatively large files from the web (such as videos with 350MB size).
  The goal here is to download these kind of files and store it on CoreData on a Binary Data field.</p>
  <p>At the moment I'm using <code>NSURLSession.dataTaskWithUrl</code> and <code>NSURLSession.dataTaskWithRequest</code> methods to retrieve these files, but it looks like these methods don't treat problems such as memory usage, they just keep on filling the memory until it reaches its maximum usage, leaving me with a memory warning when I reach 380MB~.</p>
  <p><a href="https://i.stack.imgur.com/ShOaM.png" rel="nofollow noreferrer">Initial Memory Usage</a></p>
  <p><a href="https://i.stack.imgur.com/d3Vfy.png" rel="nofollow noreferrer">Memory Warning</a></p>
  <p>What's the best strategy to perform this kind of large data retrieval from the web without reaching a memory warning? Does AlamoFire and other libs can deal with this problem?</p>