Enable GC Logging of Masters

You can enable GC logging for troubleshooting purposes.

To enable GC logging:

  1. Access the Operations Center UI, and click the "gear icon" for the Master you want to modify.

    image

  2. Click Configure on the left pane to access the masters configuration.

    image

  3. In the section labeled Java Option, add the following and select Save.

    -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=40m -Xloggc:$JENKINS_HOME/gc.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintHeapAtGC -XX:+PrintGCCause -XX:+PrintTenuringDistribution -XX:+PrintReferenceGC -XX:+PrintAdaptiveSizePolicy

Example

image

Restart the master for the changes to take effect, From the main Operations Center page, select the name of the Master → Manage → Restart.

image

Accessing the GC Logs

By default the GC logs are written to $JENKINS_HOME which is related to /var/jenkins_home/.

To write GC logs to the overlay filesystem and not to the PersistantVolume modify the variable `$JENKINS_HOME the directory needs to be writeable by the container 
Example:

-Xloggc:/tmp/gc.log

This will write the GC logs to `/tmp.