title: Java program (Tomcat) keeps eating memory (RES in top)
body: <p>I am running Tomcat on a 4-cpu and 32GB memory 64 bit machine (OS is CentOS 6.3). The Java option I start Tomcat with is <code>-server -Xms1024m -Xmx1024m -XX:PermSize=512m -XX:MaxPermSize=512m</code></p>
  
  <p>At the beginning, RES is just 810MB using top, and it keeps increasing. During this period, I run <code>jmap -J-d64 -histo pID</code> to check the Java memory heap, and I think the gc works fine, because heap peak is 510MB and around 200MB after gc. But when RES in top hits 1.1g, the CPU usage will exceeds 100% and Tomcat will hang.</p>
  
  <p>Using <code>jstack pid</code> to see the dump when the CPU usage is 100%, a thread named "vm thread" eats up almost 100% CPU. I googled, it is the JVM gc thread. So my question is: Why does res keep growing when gc works fine? How could I resolve this problem? Thanks.</p>