Automatic deletion of rotated gc.log files Automatic deletion of rotated gc.log files hadoop hadoop

Automatic deletion of rotated gc.log files


When we want to do GC log rotation then in that case we will have to define few properties together to make it work appropriately like following along with the "-Xloggc" option.

-XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=2M

need to defining NumberOfGClogFiles option will lead to inconsistent JVM options and JVM will not boot like:

So I try this:

HBASE_MASTER_OPTS=" -XX:PermSize=64m -XX:MaxPermSize={{hbase_master_maxperm_size}} -Xms{{hbase_heapsize}} -Xmx{{hbase_heapsize}} -Xmn{{hbase_master_xmn_size}} -XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=3 -XX:GCLogFileSize=20M" .

NOTE: Also in my case the JVM was not booting because there is a Typo in my case "-XX:NumberOfGClogFiles" (here I used lowercase log) where as the correct option has Uppercase L in the option like "-XX:NumberOfGCLogFiles"