title: Error handling "Out of Memory Exception" in browser?
body: <p>I am debugging a javascript/html5 web app that uses a lot of memory.  Occasionally I get an error message in the console window saying </p>
  
  <pre><code>"uncaught exception: out of memory".  
  </code></pre>
  
  <p>Is there a way for me to gracefully handle this error inside the app?</p>
  
  <p>Ultimately I need to re-write parts of this to prevent this from happening in the first place.</p>