title: How to listen for OutOfMemoryError and exit the JVM
body: <p>Is there a way to build a global <code>OutOfMemoryError</code> Listener for my Java app?</p>
  
  <p>I want to stop the JVM gracefully (<code>try-catch</code> is not an option) on OOM.</p>