Skip to content

Instantly share code, notes, and snippets.

@vikrum
Created July 2, 2012 21:57
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 vikrum/3035977 to your computer and use it in GitHub Desktop.
Save vikrum/3035977 to your computer and use it in GitHub Desktop.
Twitter's JVM startup template
# Courtesy @marius, April 2012
#
# "Our most common type of system are mostly stateless, high volume,
# low latency RPC systems. For these, we generally use this template:"
HEAP_OPTS="-Xmx17G -Xms17G -XX:NewSize=15G -XX:+UseNUMA"
GC_OPTS="-XX:+UseConcMarkSweepGC -XX:SurvivorRatio=40 -XX:+CMSScavengeBeforeRemark"
GC_LOG_OPTS="-verbosegc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps -XX:+PrintTenuringDistribution -XX:+PrintHeapAtGC"
GC_LOG="-Xloggc:/var/log/$APP_NAME/gc.log"
DEBUG_OPTS="-XX:ErrorFile=/var/log/$APP_NAME/java_error%p.log"
JAVA_OPTS="-server -Djava.net.preferIPv4Stack=true -Dstage=$STAGE $GC_OPTS $GC_LOG_OPTS $GC_LOG $HEAP_OPTS $DEBUG_OPTS"
APP_OPTS="-f /usr/local/macaw/current/config/config.scala"
ROTATE_GC_CONF="${APP_HOME}/config/rotate-gc.conf"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment