jvm

Heap Sizes

-XX:MaxPermSize=1g # permgen space, unused since java 8
-Xms1g -Xmx4g      # heap size
                   # default: initial 1/64, maximum 1/4 of your physical memory

Heap Dumps

ref oom error

-XX:-HeapDumpOnOutOfMemoryError
-XX:HeapDumpPath=/opt/dumps/glassfish.hprof

Garbage Collection

-verbose:gc
-Xloggc:/path_to_log_file/gc.log
-XX:+PrintGCDetails               # as much detail as possible
-XX:+PrintGCDateStamps            # the information is timestamped
-XX:+DisableExplicitGC            # no explicit calls to System.gc()

JMX

for remote profile

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