title: How to debug Java OutOfMemory exceptions?
body: <p>What is the best way to debug <code>java.lang.OutOfMemoryError</code> exceptions?</p>
  
  <p>When this happens to our application, our app server (Weblogic) generates a heap dump file.  Should we use the heap dump file?  Should we generate a Java thread dump?  What exactly is the difference?  </p>
  
  <hr>
  
  <p>Update: What is the best way to generate thread dumps?  Is <code>kill -3</code> (our app runs on Solaris) the best way to kill the app and generate a thread dump?  Is there a way to generate the thread dump but not kill the app?  </p>