jvm参数

1、JDK_OPTS=" -Xms1024m -Xmx1024m -Xmn192m -Xss1m -XX:PermSize=128M -XX:PermSize=512M"
2、JDK_OPTS= $JDK_OPTS" -XX:+UseParNewGC"
3、JDK_OPTS=$JDK_OPTS" -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8802"
APPLICATION_NAME=chat
MAIN_CLASS="com.zxx.server"
EXECUTABLE=/game/server/kernal.sh
exec "$EXECUTABLE" "$JDK_OPTS" "APPLICATION_NAME" "$MAIN_CLASS" 5 0 "$@" "$@"

JDK=/usr/local/java/bin
APPLICATION_HOME=/game/server/app
JDK_OPTS=$1
APPLICATION_NAME=$2
MAIN_CLASS=$3
SVR_TYPE="$4"
SVR_ID=$5
LOCAL_PATH=$APPLICATION_HOME/$APPLICATION_NAME
APPLICATION_CONFIG=$LOCAL_PATH/config/config.properties
SERVERID=$LOCAL_PATH/server.pid
GLOBAL_LIB=$APPLICATION_HOME/lib

PATH=$CLASSPATH
for i in $LOCAL_PATH/lib/*.jar;
  do
    PATH=$PATH:$i
  done

for i in $GLOBAL_LIB/*.jar;
  do
    PATH=$PATH:$i
  done

case $6 in
   start)
    $JDK/java -server $JDK_OPTS  -cp $PATH $MAIN_CLASS $APPLICATION_CONFIG $7 &
    echo $! > $SERVER_ID
    PROCESS_ID=`/bin/cat $SERVER_ID`
    if [ "$PROCESS_ID"  ]
      then
          echo " the $APPLICATION_NAME started" "$7"
      else
          /bin/rm -rf $SERVER_ID
          echo "miss config file path"
          echo "eg sh gate_server.sh start $7 "
     fi
   ;;
   stop)
    "$JDK"/java -cp $PATH com.road.zxx.StopServer $APPLICATION_CONFIG $SVR_TYPE $SVR_ID "stop" &
;;
   stopnow)
    "$JDK"/java -cp $PATH com.road.zxx.StopServer $APPLICATION_CONFIG $SVR_TYPE $SVR_ID "stopnow" &
;;
  cmd)
   "$JDK"/java -cp $PATH com.road.zxx.AdminCmdRequestor $APPLICATION_CONFIG $SVR_TYPE $SVR_ID
;;
  allcmd)
   "$JDK"/java -cp $PATH com.road.zxx.AdminCmdRequestor
;;
  kill)
     PROCESS_ID=`/bin/cat $SERVER_ID`
      if [ "$PROCESS_ID"  ]
      then
          echo " the $APPLICATION_NAME begin killing"
           /bin/rm -rf $SERVER_ID
           kill -9 $PROCESS_ID
           echo " the $APPLICATION_NAME begin killed"
      else     
          echo "the $APPLICATION_NAME is not running"
     fi
;;
   *)
    echo "Usage :$0 (start|stop|stopnow|cmd|allcmd|kill|status)"
esac
exit 0

   

    


你可能感兴趣的:(jvm参数)