Skip to content

Instantly share code, notes, and snippets.

@sameei
Created July 17, 2018 05:49
Show Gist options
  • Save sameei/42d2ab536084dbaf7d9344992de612b6 to your computer and use it in GitHub Desktop.
Save sameei/42d2ab536084dbaf7d9344992de612b6 to your computer and use it in GitHub Desktop.
#! /bin/bash
# BASE
export BINDIR=$(dirname "$0")
export HOME=$(realpath $BINDIR/..)
# LOGGING
echo "HOME: $HOME"
echo "BIN: $BINDIR"
export CMD="$BINDIR/launcher "
export CMD="$CMD -J-verbose:gc"
export CMD="$CMD -J-Xloggc:/var/log/{name}.%p_%t.gc"
export CMD="$CMD -J-XX:+PrintGCDetails"
export CMD="$CMD -J-XX:+PrintGCDateStamps"
export CMD="$CMD -J-XX:+UseGCLogFileRotation"
export CMD="$CMD -J-XX:NumberOfGCLogFiles=5"
export CMD="$CMD -J-XX:GCLogFileSize=10M"
export CMD="$CMD -J-XX:-TraceClassUnloading"
export CMD="$CMD -J-XX:+HeapDumpOnOutOfMemoryError"
export CMD="$CMD -J-XX:HeapDumpPath=/var/log/{name}-heapdumps"
export CMD="$CMD -J-Xms100m -J-Xmx100m"
export CMD="$CMD -J-Dlogback.configurationFile=$HOME/etc/stage.logback.xml"
export CMD="$CMD -J-Dconfig.file=$HOME/etc/general.conf"
export CMD="$CMD --"
# CALL
echo "$CMD "$@""
echo "..."
exec $CMD "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment