title: Limit an amount of memory for a third-party javascript
body: <p>Is it possible to limit an amount of memory that can be allocated by a third-party javascript code?</p>
  
  <p><strong>UPDATE:</strong> The ideal situation is to have a 'sandbox' where:</p>
  
  <ul>
  <li>Some user adds a piece of javascript code.</li>
  <li>This piece of code is being executed. </li>
  <li>If it allocates more than 5 mb - user gets an  exception</li>
  </ul>
  
  <p>Thanks in advance. :)</p>