title: Allocating a Java heap for Tomcat on an EC2 instance
body: <p>I'm writing a Java servlet that I'm planning to deploy on Amazon AWS using Elastic Beanstalk. My tests show that things run well using a Small EC2 instance using their stock Tomcat AMI that Beanstalk uses.</p>
  
  <p>I'm trying to figure out how to properly allocate Java heap space for this configuration. A Small instance has 1.7 GB of memory, so I'm thinking that a 1024MB heap will work well. I realize that memory will be needed for other things even though the only "real" purpose of this instance is to run Tomcat. And I also know that there's some point with large heaps where the standard Sun/Oracle JVM doesn't really work.</p>
  
  <p>Is this a reasonable way to allocate the memory? Should I be using more or less? What tools can I use to help determine the optimal configuration?</p>