title: Tomcat garbage collecting frequency
body: <p>I'm new to Java, and have just inherited a Tomcat setup so I'd like some guidance :)  I've read more in the last week about JVM tuning and garbage collecting algorithms than I would like to!</p>
  
  <p>Using Visual VM/GC our Tomcat servers are doing full GC's less that once a day. Given that most users web sessions last less than an hr, this to mee seems very infrequent, and presumably there are a lot of "dead" objects in perm gen for a long time?  So does this just mean that we have plenty of RAM/heap space, and it simply doesn't need to collect so it doesn't?  </p>
  
  <p>Given this, would it be better to make the old gen smaller and the new gen bigger, as the rate of promotion is very small?</p>
  
  <p>I'm asking, because there are indications elsewhere in the OS that we might have memory pressures, but the JVM/GC logs seems to contradict the OS.</p>
  
  <p>Related to this -</p>
  
  <p>We currently have <code>min-heap=max-heap=6Gb</code>.  If <code>top</code> is showing a java process size of 7-8Gb, but a RSS of 5-6Gb, presumably this means that 2Gb is swapped out?  In which case it's doing to die when it full GCs.  So would it be better to have a smaller min-heap size that GCs more often before the OS swaps it out.</p>
  
  <p>Is it generally best to leave the JVM to tune itself rather than getting obesesed with settings all the parameters manually or do most people set the params manually?</p>