title: Memory running out side of Xmx and Xms
body: <p>I have run into an issue with a java application I wrote causing hardware performance issues.  The problem (I'm fairly certain), is that a few of the machines that I'm running the application on only have 1GB of memory.  When I start my java application, I"m setting the heap size to -Xms 512m -Xmx 1024m.  </p>
  
  <p>My first question, is my assumption correct that this will obviously cause performance problems because I'm allocating all of the machines memory to the java heap?</p>
  
  <p>This leads to another question.  I'm running jconsole on the app and monitoring the apps memory usage.  What I'm seeing is that the app consumes about 30mb at startup, gets to about 150mb and the garbage collector runs and it goes back down to 30mb.  What I'm also seeing using top on the pid is that the application starts by using about 6% memory then slowly climbs up to about 20%.  I do not understand this.  Why would it only get up to 20% memory usage when I'm allocating 1GB to it.  Shouldn't it go to 100%.  Also, why is it using that much memory (20%) when it doesn't appear that the app ever uses more than 150mb?</p>
  
  <p>I think its pretty obvious I need to adjust my Xms and Xmx and that should resolve the issue, but I'm trying to understand better what exactly is happening.</p>