title: Mobile Safari/WebKit memory issues
body: <p>We are writing an HTML 5 app that requires large files to be loaded.</p>
  
  <p>We are loading binary data files via ajax. The app always crashes on iPad. </p>
  
  <p>Upon further investigation with instruments on a MAC we noticed that while downloading the file, the memory allocated for webkit exponentially grows then runs out of memory. (100MB file grows memory over 550MB then browser crashes)</p>
  
  <p>We tested loading all kinds of other types of files via other methods such as the Image obj as shown below.</p>
  
  <pre><code>function testImage() {
          var download = new Image();
          download.src = 'data/33MB.jpg?n=' + new Date().getTime();
      }
  </code></pre>
  
  <p>After the above 33MB image loads, Instruments show us that the memory has grown to 309 MB.</p>
  
  <p><a href="https://i.stack.imgur.com/ZhORq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZhORq.png" alt="Instruments panel"></a></p>
  
  <p>And here is a sample XHR call with same results loading a large binary file.</p>
  
  <pre><code>function testXHR() {
      var xhr = new XMLHttpRequest();
      xhr.open('GET', 'data/100MB.bin?n=' + new Date().getTime());
      xhr.send();
  }
  </code></pre>
  
  <p>We are baffled as to what is happening. 
  How could we load large files on safari mobile? </p>
  
  <p>Any insight would be appreciated. Thanks in advance.</p>