Skip to content

Instantly share code, notes, and snippets.

@tlasica
Created February 17, 2016 00:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tlasica/410e4e7cacdf40ef9c79 to your computer and use it in GitHub Desktop.
Save tlasica/410e4e7cacdf40ef9c79 to your computer and use it in GitHub Desktop.
Script to enable/disable gc
COMMAND=$1
FILE=$DSE_CASS_CONFIG_HOME/jvm.options
OPTIONS=(
'-XX:+PrintGCDetails'
'-XX:+PrintGCDateStamps'
'-XX:+PrintHeapAtGC'
'-XX:+PrintTenuringDistribution'
'-XX:+PrintGCApplicationStoppedTime'
'-XX:+PrintPromotionFailure'
'-XX:PrintFLSStatistics'
'-Xloggc'
'-XX:+UseGCLogFileRotation'
'-XX:NumberOfGCLogFiles'
'-XX:GCLogFileSize'
)
function enable() {
for o in "${OPTIONS[@]}"; do
CMD="s/^#$o/$o/"
sed -i $CMD $FILE
done
}
function disable() {
for o in "${OPTIONS[@]}"; do
CMD="s/^$o/#$o/"
sed -i $CMD $FILE
done
}
$COMMAND
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment