title: Generating a Java thread dump on an event/exception
body: <p>I worked mainly with the IBM SDK so there is a specific JVM argument you can use in order to enable dumps (heap, thread, system core) on specific events or exceptions (java.lang.OutOfMemoryError, SIGTERM, etc...)</p>
  
  <p>I want to be able to do the same thing using the Oracle JDK. I only see the argument: <strong>-XX:+HeapDumpOnOutOfMemoryError</strong> which will only generate a heap dump for the specific exception java.lang.OutOfMemoryError. </p>
  
  <p>Basically I do not have access to the code, so I want to be able to have the JVM generate both a heap dump and a Java thread dump for analysis (java.lang.OutOfMemoryError is one of many other events). </p>