jstat -gcutil 123456 2000 1000
123456 is pid
2000 is a sampling period in milliseconds
1000 is the number of samples
Description 100% should be enough jvm heap memory or a memory leak
jmap -dump:file=heap.dump 123456
Shows the output associated with the gc heap of information
jstat -gc 123456
Shows the causes of the most recent and current gc gc of reasons
jstat -gccause 123456
java heap can be subdivided into: the old and the new generation's there again more carefully Eden space From Survivor space, To Survivor space
-Xmx: maximum push is the maximum size of the new generation and the old age and, it is the upper limit of the application heap.
-Xms: minimum heap space can be used to set the system. That is, the JVM starts, occupied by the operating system memory size.
-Xmn: used to set the size of the new generation
tomcat catlina.sh
JAVA_OPTS="-Xms2048m -Xms2048m -Xmn800m -XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=512m -XX:MaxTenuringThreshold=10 -XX:+PrintGCDateStamps -verbose:gc -XX:+PrintGCDetails -