#!/bin/sh

set -e

if [ x${APP_ENV} = "xpro" ]
then
    # JAVA_OPTS=" -Xms6144m -Xmx6144m -Xmn2304m -Xss1024k -XX:PermSize=512m -XX:MaxPermSize:512m -XX:ActiveProcessorCount=4"
    JAVA_OPTS=" -Xms20000m -Xmx36000m -Xmn8304m -Xss1024k -XX:PermSize=512m -XX:MaxPermSize:512m"
elif  [  x${APP_ENV} = "xbeta" ]
then
    JAVA_OPTS=" -Xms2560M -Xmx2560M -Xmn960m -Xss1024k -XX:PermSize=512m -XX:MaxPermSize:512m -XX:ActiveProcessorCount=2"
elif  [ x${APP_ENV} = "xtest" ]
then
    # JAVA_OPTS=" -Xms2560M -Xmx2560M -Xmn960m -Xss1024k -XX:PermSize=512m -XX:MaxPermSize:512m -XX:ActiveProcessorCount=2"
    JAVA_OPTS=" -Xms6144m -Xmx6144m -Xmn2304m -Xss1024k -XX:PermSize=512m -XX:MaxPermSize:512m -XX:ActiveProcessorCount=4"
fi

java -Duser.timezone=Asia/Shanghai   ${JAVA_OPTS}   -javaagent:/agent/skywalking-agent.jar -jar /order-center-tool-0.0.1-SNAPSHOT.jar