Enable GC logging for troubleshooting purposes.
To enable GC logging:
-
From the operations center dashboard, select the arrow to the right of your controller, and then select Configure from the dropdown menu.
Figure 1. Operations center dashboard -
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
Figure 2. Java Options example -
Navigate to the operations center dashboard, select the arrow to the right of your controller, and then select
to restart the controller for the changes to take effect.
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
.