java启动参数 设置

JAVA_MEM_OPTS=""

BITS=`java -version 2>&1 | grep -i 64-bit`

if [ -n "$BITS" ]; then

    JAVA_MEM_OPTS=" -server -Xmx4g -Xms4g -Xmn256m -XX:PermSize=128m -Xss256k -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+UseCMSCompactAtFullCollection -XX:LargePageSizeInBytes=128m -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 "

else

    JAVA_MEM_OPTS=" -server -Xms4g -Xmx4g -XX:PermSize=128m -XX:SurvivorRatio=2 -XX:+UseParallelGC "

fi


RUN_ARGS=(${JAVA_OPTIONS[@]} -jar "$JETTY_START" ${JETTY_ARGS[*]} ${JAVA_MEM_OPTS})

posted @ 2017-03-16 10:18  托马斯布莱克  阅读(1238)  评论(0编辑  收藏  举报