title: Java: Unable to create new native thread
body: <p>I have a Java application that is hosted on by a web hosting company.  Every few days my app goes down with:</p>
  
  <pre><code>[2011-03-09 15:52:14,501] ERROR http-12021-9 
  java.lang.OutOfMemoryError: unable to create new native thread
      at java.lang.Thread.start0(Native Method)
      at java.lang.Thread.start(Thread.java:597)
  </code></pre>
  
  <p>The hosting company says it means my app is leaking memory, but the tools I have are showing free memory is still available.  Since the error is always creating a new native thread my thinking is that the issue is in the JVM config/OS resources.</p>
  
  <p>How do I prevent this error from happening?</p>