Java memory settings

Understanding Java Memory Settings

Summary:

if max memory exceeds you get out of memory exception

good to set both mn and mx values the same

jvm tuning

This links talks about why the two mn and mx values need to be close or same

Garbage collection tuning from sun

jvm tuning faq from sun/oracle

turbo charging hotspot vm

Best results on J2SE1.4.1 using the default garbage collectors in the young and old generations for the chosen size of the JVM heap:

java -Xmx512m -Xms512m -XX:MaxNewSize=24m -XX:NewSize=24m -XX:SurvivorRatio=2 (application)

Average GC pause in old generation: 3 secs. 
Average GC pause in young generation: 110 ms. 
GC sequential overhead: 18.9%