Enable GC logging of controllers

1 minute read

Enable GC logging for troubleshooting purposes.

To enable GC logging:

  1. Go to the operations center dashboard and select the gear icon for the controller you want to modify.

    operations center dashboard
    Figure 1. Operations center dashboard
  2. Select Configure on the left pane to access the controller’s configuration.

    configure controller
    Figure 2. Configure controller
  3. In the Java Options field, enter the following command and select Save.

    -Xlog:gc*=info,gc+heap=debug,gc+ref*=debug,gc+ergo*=trace,gc+age*=trace:file=$JENKINS_HOME/gc.log:utctime,pid,level,tags:filecount=2,filesize=100M
    Java Options example
    Figure 3. Java Options example
  4. Restart the controller for the changes to take effect.

    1. Navigate to the operations center dashboard.

    2. Select the name of the controller and the select Manage  Restart.

      Restarting controller
      Figure 4. Restarting controller

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.