Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

allow for garbage collection algo preference #40

Merged
merged 8 commits into from
Nov 2, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ recommended for ease of configuration.
| `GAME_VERSION` | Game version to serve | [a-zA-Z0-9_]+ | `public` |
| `MAP_NAMES` | Map Names (e.g. North;South) | map1;map2;map3 | Muldraugh, KY |
| `MAX_RAM` | Maximum amount of RAM to be used | ([0-9]+)m | 4096m |
| `GC_CONFIG` | Specifices Java GC to use | ([0-9]+)m | ZGC |
| `STEAM_VAC` | Use Steam VAC anti-cheat | (true|false) | true |
| `USE_STEAM` | Create a Steam Server, or a Non-Steam Server | (true|false) | true |

Expand Down Expand Up @@ -217,6 +218,7 @@ The following are instructions for running the server using the Docker image.
[--env=MAP_NAMES=<value>] \
[--env=MAX_PLAYERS=<value>] \
[--env=MAX_RAM=<value>] \
[--env=GC_CONFIG=<value>] \
[--env=MOD_NAMES=<value>] \
[--env=MOD_WORKSHOP_IDS=<value>] \
[--env=PAUSE_ON_EMPTY=<value>] \
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ services:
- "MAP_NAMES=Muldraugh, KY"
- "MAX_PLAYERS=16"
- "MAX_RAM=4096m"
- "GC_CONFIG=ZGC"
- "MOD_NAMES="
- "MOD_WORKSHOP_IDS="
- "PAUSE_ON_EMPTY=true"
Expand Down
6 changes: 6 additions & 0 deletions src/run_server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ function apply_postinstall_config() {

# Set the maximum amount of RAM for the JVM
sed -i "s/-Xmx.*/-Xmx$MAX_RAM\",/g" "$SERVER_VM_CONFIG"

# Set the GC for the JVM (advanced, some crashes can be fixed with a different GC algorithm)
sed -i "s/-XX\+UseZGC.*/-XX\+Use$GC_CONFIG\",/g" "$SERVER_VM_CONFIG"

printf "\n### Post Install Configuration applied.\n"
}
Expand Down Expand Up @@ -188,6 +191,9 @@ function set_variables() {

# Set the Maximum RAM variable
MAX_RAM=${MAX_RAM:-"4096m"}

# Sets GC
GC_CONFIG=${GC_CONFIG:-"ZGC"}

# Set the Mods to use from workshop
MOD_NAMES=${MOD_NAMES:-""}
Expand Down