-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart.sh
30 lines (23 loc) · 1.17 KB
/
start.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
25
26
27
28
29
30
#!/bin/ash
# Credits: https://steinborn.me/posts/tuning-minecraft-openj9/
#
# Properly tunes a Minecraft server to run efficiently under the
# OpenJ9 (https://www.eclipse.org/openj9) JVM.
#
# Licensed under the MIT license.
#
## BEGIN CONFIGURATION
# HEAP_SIZE: This is how much heap (in MB) you plan to allocate
# to your server. By default, this is set to 4096MB,
# or 4GB.
HEAP_SIZE=${SERVER_MEMORY}
## END CONFIGURATION -- DON'T TOUCH ANYTHING BELOW THIS LINE!
## BEGIN SCRIPT
# Compute the nursery size.
NURSERY_MINIMUM=$(($SERVER_MEMORY / 2))
NURSERY_MAXIMUM=$(($SERVER_MEMORY * 4 / 5))
# Launch the server.
CMD="java -Xms${SERVER_MEMORY}M -Xmx${SERVER_MEMORY}M -Xmns${NURSERY_MINIMUM}M -Xmnx${NURSERY_MAXIMUM}M -Xgc:concurrentScavenge -Xgc:dnssExpectedTimeRatioMaximum=3 -Xgc:scvNoAdaptiveTenure -Xdisableexplicitgc -XX:+AlwaysPreTouch -XX:+DisableExplicitGC -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:MaxGCPauseMillis=45 -XX:TargetSurvivorRatio=90 -XX:G1NewSizePercent=50 -XX:G1MaxNewSizePercent=80 -XX:InitiatingHeapOccupancyPercent=10 -XX:G1MixedGCLiveThresholdPercent=50 -XX:+AggressiveOpts -jar ${SERVER_JARFILE}"
echo "${CMD}"
${CMD}
## END SCRIPT