-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.sh
executable file
·31 lines (29 loc) · 1.19 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
31
#!/bin/bash
#Settings
[[ -f config.sh ]] && . config.sh
SERVICE="${FORGE:-server.jar}"
OPTIONS='nogui'
MCPATH="${SERVER_DIR}"
# -Dfml.debugClassPatchManager=true -Dfml.debugRegistryEntries=true \
# -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:ParallelGCThreads=8 -XX:ConcGCThreads=2 -XX:InitiatingHeapOccupancyPercent=70 -XX:+DisableExplicitGC -XX:+UseFastAccessorMethods -XX:+AggressiveOpts -XX:-UseAdaptiveSizePolicy \
# Garbage Collector optimizations are from https://forums.spongepowered.org/t/optimized-startup-flags-for-consistent-garbage-collection/13239
INVOCATION="java -server \
-Xms${START_MEMORY}M -Xmx${MAX_MEMORY}M \
-XX:+UseLargePages \
-XX:+UseLargePagesInMetaspace \
-XX:+UseG1GC \
-XX:+UnlockExperimentalVMOptions \
-XX:MaxGCPauseMillis=100 \
-XX:+DisableExplicitGC \
-XX:TargetSurvivorRatio=90 \
-XX:G1NewSizePercent=50 \
-XX:G1MaxNewSizePercent=80 \
-XX:InitiatingHeapOccupancyPercent=10 \
-XX:G1MixedGCLiveThresholdPercent=50 \
-XX:+AggressiveOpts \
-XX:+AlwaysPreTouch \
-Djline.terminal=unix -Djava.util.prefs.userRoot=${SERVER_DIR} \
-Djava.net.preferIPv4Stack=true \
-jar $SERVICE $OPTIONS"
# -Dfml.doNotBackup=true -Dfml.queryResult=confirm \
${INVOCATION}