- Notifications
You must be signed in to change notification settings - Fork 178
Expand file tree
/
Copy pathstartJavaServer
More file actions
Latest commit
executable file
·13 lines (10 loc) · 483 Bytes
/
Copy pathstartJavaServer
File metadata and controls
executable file
·13 lines (10 loc) · 483 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/bash
export MAIN_DIR=$PWD
export JAVA=$MAIN_DIR/bin/java_bins/bin/java
cd server
mem=$(grep MemTotal /proc/meminfo | sed -e 's/MemTotal:[ ]*//'| sed -e 's/ kB//')# some new stuff
mem=$(($mem/1024/1024))
#uncomment this below line only if the server you are running is 1.17+ (if it is uncommented by default keep it as it is).
$JAVA -Xmx${mem}G -Xms${mem}G -jar server.jar nogui
# for 1.16 or lower uncomment this line
#java -Xmx${mem}G -Xms${mem}G -jar server.jar nogui