forked from zjpjohn/pbrpc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
local_run_server.sh
25 lines (22 loc) · 1.02 KB
/
local_run_server.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
WORKDIR=`pwd`
OUTPUT=output
ENGINE_DIR=output/engine
mkdir -p $ENGINE_DIR
mvn clean dependency:copy-dependencies -DoutputDirectory=$OUTPUT/lib package -Dmaven.test.skip=true
cp target/pbrpc-0.0.1-SNAPSHOT.jar $OUTPUT
jarfilelist=`ls -l $OUTPUT/lib/*.jar | awk '{print $NF}'`
jarfiles=
for file in $jarfilelist
do
if [ jarfiles == '' ]; then
jarfiles=$file
else
jarfiles=$jarfiles:$file
fi
done
cd $ENGINE_DIR && jar xf ../pbrpc-0.0.1-SNAPSHOT.jar
cd $WORKDIR
JVM_HEAP_MAX=4096
JVM_OPT="-server -Xmx${JVM_HEAP_MAX}m -Xms${JVM_HEAP_MAX}m -XX:SurvivorRatio=8 -XX:NewRatio=4 -XX:PermSize=128m -XX:MaxPermSize=256m -XX:+HeapDumpOnOutOfMemoryError -XX:+DisableExplicitGC -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintCommandLineFlags -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:ParallelCMSThreads=4 -XX:+CMSClassUnloadingEnabled -XX:+UseCMSCompactAtFullCollection -XX:CMSFullGCsBeforeCompaction=1 -XX:CMSInitiatingOccupancyFraction=72"
java $JVM_OPT -Dfile.encoding=UTF-8 -cp $ENGINE_DIR:$jarfiles dos.des.server.App