title: I get "Java HotSpot(TM) 64-Bit Server VM warning: Exception java.lang.OutOfMemoryError occurred dispatching signal SIGTERM to handler" error in tomcat
body: <p>I have tomcat web app on VPS and the tomcat sometimes (about once a month) crashes with the following error in catalina.out:</p>
  
  <blockquote>
    <p>Java HotSpot(TM) 64-Bit Server VM warning: Exception java.lang.OutOfMemoryError occurred dispatching signal SIGTERM to handler- the VM may need to be forcibly terminated.</p>
  </blockquote>
  
  <p>Here are some details about my configuration:</p>
  
  <ul>
  <li><p>VPS: debian-5.0-x86_64</p></li>
  <li><p>RAM: 2.5 gb,</p></li>
  <li><p>virtual processors: 8</p></li>
  <li><p>HDD: 60gb hdd - 70% free</p></li>
  <li><p>Tomcat 7.0</p></li>
  <li><p>java -version:</p>
  
  <pre><code>java version "1.6.0_18"
  OpenJDK Runtime Environment (IcedTea6 1.8.13) (6b18-1.8.13-0+squeeze1)
  OpenJDK 64-Bit Server VM (build 14.0-b16, mixed mode)
  </code></pre></li>
  <li><p>Java params:  -Xms512m -Xmx1024m</p></li>
  </ul>
  
  <p>I have also Apache-PHP on that server.</p>
  
  <p>I'm monitoring server load with Munin and it shows me that memory and CPU usage is always stable and there were no any increases before crash.</p>
  
  <p>I'm also logging java memory usage via java.lang.Runtime class, and it shows that jvm always uses max200Mb memory and there were no increase before crash. The last log before crash was 40 seconds ago and that time used memory was: 152Mb.</p>
  
  <p>My web app also runs 6-7 threads that collecting data from different public APIs. These threads start when tomcat is starting, and they always running with periodic sleeps.  </p>
  
  <p>Can you please tell me why it crashes? How can I find the reason?</p>