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"50"$@""$@"

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

foriin$LOCAL_PATH/lib/*.jar;

do

PATH=$PATH:$i

done

foriin$GLOBAL_LIB/*.jar;

do

PATH=$PATH:$i

done

case$6in

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_NAMEstarted""$7"

else

/bin/rm-rf$SERVER_ID

echo"missconfigfilepath"

echo"egshgate_server.shstart$7"

fi

;;

stop)

"$JDK"/java-cp$PATHcom.road.zxx.StopServer$APPLICATION_CONFIG$SVR_TYPE$SVR_ID"stop"&

;;

stopnow)

"$JDK"/java-cp$PATHcom.road.zxx.StopServer$APPLICATION_CONFIG$SVR_TYPE$SVR_ID"stopnow"&

;;

cmd)

"$JDK"/java-cp$PATHcom.road.zxx.AdminCmdRequestor$APPLICATION_CONFIG$SVR_TYPE$SVR_ID

;;

allcmd)

"$JDK"/java-cp$PATHcom.road.zxx.AdminCmdRequestor

;;

kill)

PROCESS_ID=`/bin/cat$SERVER_ID`

if["$PROCESS_ID"]

then

echo"the$APPLICATION_NAMEbeginkilling"

/bin/rm-rf$SERVER_ID

kill-9$PROCESS_ID

echo"the$APPLICATION_NAMEbeginkilled"

else

echo"the$APPLICATION_NAMEisnotrunning"

fi

;;

*)

echo"Usage:$0(start|stop|stopnow|cmd|allcmd|kill|status)"

esac

exit0

相关推荐