The following Java startup parameters should be used (and the values adjusted) when running a Java process on a server.
1 2 3 4 5 6 7 8 9 10 |
-Xmx1G -Xmx4G -XX:+UseG1GC -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps -Xloggc:Gc.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M |
When a Java process starts, it overwrites an existing GC log file. I would recommend to either use a timestamp in the filename or use the %pid placeholder.
If you want to use JMX, also add the following parameters:
1 2 3 |
-Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=1888 -Dcom.sun.management.jmxremote.authenticate=false |