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})

你可能感兴趣的:(java启动参数 设置)