Typical JVM arguments
Class memory parameterization
-XX:+UseG1GC -XX:+ExplicitGCInvokesConcurrent -Xmx3G -Xms3G -XX:MaxDirectMemorySize=7G -XX:MaxPermSize=512M
Enable HeapDump on OutOfMemoryError
-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/disk2/dumps
-DbufferAllocatorClass=com.qfs.buf.impl.HeapBufferAllocator
-DchunkAllocatorClass=com.qfs.chunk.buffer.impl.HeapBufferChunkAllocator -DdefaultChunkSize=131072
-DchunkAllocatorClass=com.qfs.chunk.direct.impl.DirectChunkAllocator
-DchunkAllocatorClass=com.qfs.chunk.direct.impl.MmapDirectChunkAllocator
-DchunkAllocatorClass=com.qfs.chunk.direct.allocator.impl.SlabMemoryAllocator
java -XX:+PrintFlagsFinal -version > flags.log
-XX:+PrintGCApplicationStoppedTime - it prints all STW pauses not only related to GC
-XX:+PrintSafepointStatistics - prints safe points details
-XX:PrintSafepointStatisticsCount=1 - make JVM report every safe point
<%p> will add the PID in the gcLogFile <%t> will add the startup date in the gcLogFile
https://bugs.openjdk.java.net/browse/JDK-6950794
Minimum logs in sysout
-XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps
For -Xloggc, %p.%t are very important else gc logs will be overriden on each restart
-Xloggc:../log/jvm_gc.%p.%t.log -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+PrintGCDetails
-XX:+PrintClassHistogramBeforeFullGC -XX:+PrintClassHistogramAfterFullGC -XX:+PrintGCApplicationStoppedTime
-XX:+PrintSafepointStatistics –XX:PrintSafepointStatisticsCount=1
GC rolling
-XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 XX:GCLogFileSize=10M
In Prod -XX:-OmitStackTraceInFastThrow will prevent cutting stacks, even if at least the first stack occurence has
been complete
JGroups does not work with IPv6 -Djava.net.preferIPv4Stack=true
# CheckIP with: hostname -i
-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=1088
-Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false
-Djava.rmi.server.hostname=