JVM


JVM – Aggregation of the most frequently used jvm parameters

Max/Start Heap Size

  1. -Xmx2g
  2. -Xms2g

Garbage Collector Algorithms

  1. -XX:+UseSerialGC
  2. -XX:+UseParallelGC
  3. -XX:+UseParNewGC
  4. -XX:+UseG1GC

Garbage Collector Logging

  1. -XX:+UseGCLogFileRotation
  2. -XX:NumberOfGCLogFiles=10
  3. -XX:GCLogFileSize=50M
  4. -Xloggc:/path.log
  5. -XX:+PrintGCTimeStamps
  6. -XX:+PrintGCDateStamps

Heap dump on out of memory exception

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

Jmx configuration

No authentication

  1. -Dcom.sun.management.jmxremote
  2. -Dcom.sun.management.jmxremote.port=8086
  3. -Dcom.sun.management.jmxremote.ssl=false
  4. -Dcom.sun.management.jmxremote.authenticate=false

Password authentication

  1. -Dcom.sun.management.jmxremote
  2. -Dcom.sun.management.jmxremote.port=8086
  3. -Dcom.sun.management.jmxremote.ssl=false
  4. -Dcom.sun.management.jmxremote.authenticate=true
  5. -Dcom.sun.management.jmxremote.password.file=./jmxremote.password
  6. -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