Skip to content

Instantly share code, notes, and snippets.

@smarter
Created February 18, 2019 16:32
Show Gist options
  • Save smarter/f06ffc4f7a30175abf4b954571a8895b to your computer and use it in GitHub Desktop.
Save smarter/f06ffc4f7a30175abf4b954571a8895b to your computer and use it in GitHub Desktop.
#!/bin/bash
#SBT_OPTS="-Xms512M -Xmx4096M -XX:ReservedCodeCacheSize=1024M -XX:+CMSClassUnloadingEnabled"
#SBT_OPTS="-Xms512M -Xmx1536M -XX:+CMSClassUnloadingEnabled -XX:MaxInlineLevel=35"
SBT_OPTS="-Xms512M -Xmx6192M -XX:ReservedCodeCacheSize=1024M -XX:+CMSClassUnloadingEnabled -XX:MaxInlineLevel=35"
ARGS=()
while [ $# -ne 0 ]; do
case $1 in
-D*)
JAVA_OPTS="$JAVA_OPTS $1"
shift
;;
-J-*)
opt=${1#"-J"}
JAVA_OPTS="$JAVA_OPTS $opt"
shift
;;
*)
ARGS+=("$1")
shift
;;
esac
done
if [ -e "$JAVA_HOME" ]; then
PATH="$JAVA_HOME"/bin:"$PATH"
fi
exec java $SBT_OPTS $JAVA_OPTS -jar $HOME/bin/sbt-1.2.3/sbt/bin/sbt-launch.jar "${ARGS[@]}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment