JVM – Aggregation of the most frequently used jvm parameters


Max/Start Heap Size

-Xmx2g
-Xms2g

Garbage Collector Algorithms

-XX:+UseSerialGC
-XX:+UseParallelGC
-XX:+UseParNewGC
-XX:+UseG1GC

Garbage Collector Logging

-XX:+UseGCLogFileRotation 
-XX:NumberOfGCLogFiles=10
-XX:GCLogFileSize=50M
-Xloggc:/path.log
-XX:+PrintGCTimeStamps
-XX:+PrintGCDateStamps

Heap dump on out of memory exception

-XX:+HeapDumpOnOutOfMemoryError
-XX:HeapDumpPath=./path.hprof

Jmx configuration

No authentication

-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=8086
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false

Password authentication

-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=8086
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=true 
-Dcom.sun.management.jmxremote.password.file=./jmxremote.password 
-Dcom.sun.management.jmxremote.access.file=./jmxremote.access

http://www.baeldung.com/jvm-parameters
http://docs.oracle.com/javase/7/docs/technotes/guides/management/agent.html

Leave a comment

Your email address will not be published. Required fields are marked *