Enable Java Garbage Collection (GC) log for Policy Server
search cancel

Enable Java Garbage Collection (GC) log for Policy Server

book

Article ID: 282420

calendar_today

Updated On: 04-22-2024

Products

SITEMINDER

Issue/Introduction

Support team may ask for gc log for troubleshooting gc related issues, such as long gc time.

Environment

Linux

Resolution

This can be done by adding gc options to the JVMOptions.txt file, and restart the policy server to take effect.

Note that the java options for gc are changed between java 8 and java 11.

Examples,

  • Java 8
    Append following lines in /opt/CA/siteminder/config/JVMOptions.txt
    -XX:+PrintGCDetails
    -Xloggc:/opt/CA/siteminder/log/gc.log
    -XX:+PrintGCTimeStamps
    -XX:+PrintGCDateStamps
    -XX:+UseGCLogFileRotation
    -XX:NumberOfGCLogFiles=5
    -XX:GCLogFileSize=10M
  • Java 11
    Append following line in /opt/CA/siteminder/config/JVMOptions.txt
    -Xlog:gc*:/opt/CA/siteminder/log/gc.log:time,level,tags:filecount=5,filesize=10M

Note2: if gc log is not enable, and you don't want to restart policy server for now, the command below can check the current gc status of policy server,

ps aux|grep smpolicysrv|grep -v grep|awk '{print $2}'|xargs jstat -gcutil

Note3: the policy server will not init the JVM immediately after restart. i.e. the gc log may not show up immediately.