April 1, 2020
Estimated Post Reading Time ~

How to Configure the Garbage Collection Log to Roll Over

With the availability of GC log analyzers such as GCEasy (online, free) and jClarity’s Censum (offline, 7-day free trial), analyzing AEM’s GC behaviour has become much easier.

To enable GC logging, as well as to have the log file rollover once it hits a certain size (e.g. 10 MB), here are the JVM arguments that you can pass in (Windows example):

set CQ_JVM_OPTS=%CQ_JVM_OPTS% -Xloggc:C:\TEMP\gc.log
set CQ_JVM_OPTS=%CQ_JVM_OPTS% -XX:+PrintGCDetails
set CQ_JVM_OPTS=%CQ_JVM_OPTS% -verbosegc
set CQ_JVM_OPTS=%CQ_JVM_OPTS% -XX:+PrintGCDateStamps
set CQ_JVM_OPTS=%CQ_JVM_OPTS% -XX:+PrintGCTimeStamps
set CQ_JVM_OPTS=%CQ_JVM_OPTS% -XX:+PrintHeapAtGC
set CQ_JVM_OPTS=%CQ_JVM_OPTS% -XX:+PrintTenuringDistribution
set CQ_JVM_OPTS=%CQ_JVM_OPTS% -XX:+PrintGCApplicationStoppedTime
set CQ_JVM_OPTS=%CQ_JVM_OPTS% -XX:+PrintReferenceGC
set CQ_JVM_OPTS=%CQ_JVM_OPTS% -XX:+PrintAdaptiveSizePolicy
set CQ_JVM_OPTS=%CQ_JVM_OPTS% -XX:+UseGCLogFileRotation
set CQ_JVM_OPTS=%CQ_JVM_OPTS% -XX:NumberOfGCLogFiles=10
set CQ_JVM_OPTS=%CQ_JVM_OPTS% -XX:GCLogFileSize=10M


By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.