title: 'std::bad_alloc' in Java program
body: <p>I have a java process which I startup and let run for several days. The logs for this process looked fine up until the very end of the process's lifetime where I see the following two lines, and then nothing after it.</p>
  
  <pre><code>terminate called after throwing an instance of 'std::bad_alloc'
    what():  std::bad_alloc
  </code></pre>
  
  <p>There is supposed to be some shutdown logic which is executed when the process ends, but these two log lines are all I see.</p>
  
  <p>What is the cause of this <code>std::bad_alloc</code> error? I've seen several other posts regarding this error but they are all from C++ programmers, whereas I am using Java, not C++. Does this indicate a bug in the JVM, or is it a consequence of some JVM related error such as an OutOfMemoryError?</p>