title: Can you catch an out of memory error in JavaScript
body: <p>I'm building a mobile web app that will rely on caching. 
  If my cache uses to much memory I'm seeing this message in mobile Safari...</p>
  
  <blockquote>
    <p>"A problem occurred with this webpage so it was reloaded". </p>
  </blockquote>
  
  <p>Without intervention the page will reload and do the same thing over again a few times until it gives up.</p>
  
  <p>Are there events I can capture, heap information I can monitor or settings that I can change to build a caching system that is more resilient than forcing page reloads?</p>
  
  <p>Chrome has <code>window.performace.memory</code> but I can't seem to find anything related to solving my issue in mobile Safari. Try/catch statements and onBeforeUnload events don't prevent the page loads or provide an opportunity to clear/reduce the cache.</p>