From 25b91a3116f5c22d2044eb30d34062a810db0738 Mon Sep 17 00:00:00 2001 From: fithwum Date: Sun, 12 Nov 2023 07:38:00 -0800 Subject: [PATCH] updates/java memory testing --- fabric/run.sh | 2 +- testing/Dockerfile | 4 ++++ testing/install_script.sh | 5 +++++ testing/run.sh | 2 +- vanilla/Dockerfile | 1 + vanilla/run.sh | 2 +- 6 files changed, 13 insertions(+), 3 deletions(-) diff --git a/fabric/run.sh b/fabric/run.sh index f3175ad..6fa52b3 100644 --- a/fabric/run.sh +++ b/fabric/run.sh @@ -6,7 +6,7 @@ cd /MCserver JAR=./fabric-*-*.jar while [ true ]; do - java -Xmx4G -Xms1024M -Xmn1G -jar $JAR nogui + java -Xmx4G -Xms1G -Xmn1G -jar $JAR nogui if [ $? -eq 0 ]; then break fi diff --git a/testing/Dockerfile b/testing/Dockerfile index 57148b8..4e21423 100644 --- a/testing/Dockerfile +++ b/testing/Dockerfile @@ -1,9 +1,13 @@ FROM fithwum/debian-base:bullseye LABEL maintainer "fithwum" +# Environment Variables ENV ACCEPT_EULA="" ENV GAME_PORT="" ENV MC_VERSION="" +ENV XMX="" +ENV XMS="" +ENV XMN="" # URL's for files ARG INSTALL_SCRIPT=https://gitlab.fithwum.tech/fithwum/minecraft/-/raw/master/testing/install_script.sh diff --git a/testing/install_script.sh b/testing/install_script.sh index a714d9d..5ff0597 100644 --- a/testing/install_script.sh +++ b/testing/install_script.sh @@ -88,6 +88,11 @@ fi sleep 1 echo "INFO ! Setting game port." sed -i '/server-port='*'/c\server-port='$GAME_PORT'' /MCserver/server.properties + +echo "INFO ! Setting java memory size." +sed -i '/-Xmx'*'/c\-Xmx'$XMX'' /MCserver/run-*.sh +sed -i '/-Xms'*'/c\-Xms'$XMS'' /MCserver/run-*.sh +sed -i '/-Xmn'*'/c\-Xmn'$XMN'' /MCserver/run-*.sh sleep 1 # Set permissions. diff --git a/testing/run.sh b/testing/run.sh index a0791b3..6ae7614 100644 --- a/testing/run.sh +++ b/testing/run.sh @@ -6,7 +6,7 @@ cd /MCserver JAR=./MCserver-*.jar while [ true ]; do - java -Xmx4G -Xms1024M -Xmn1G -jar $JAR nogui + java -Xmx4G -Xms1G -Xmn1G -jar $JAR nogui if [ $? -eq 0 ]; then break fi diff --git a/vanilla/Dockerfile b/vanilla/Dockerfile index 7ec21d2..b8a464b 100644 --- a/vanilla/Dockerfile +++ b/vanilla/Dockerfile @@ -1,6 +1,7 @@ FROM fithwum/debian-base:bullseye LABEL maintainer "fithwum" +# Environment Variables ENV ACCEPT_EULA="" ENV GAME_PORT="" ENV MC_VERSION="" diff --git a/vanilla/run.sh b/vanilla/run.sh index a0791b3..6ae7614 100644 --- a/vanilla/run.sh +++ b/vanilla/run.sh @@ -6,7 +6,7 @@ cd /MCserver JAR=./MCserver-*.jar while [ true ]; do - java -Xmx4G -Xms1024M -Xmn1G -jar $JAR nogui + java -Xmx4G -Xms1G -Xmn1G -jar $JAR nogui if [ $? -eq 0 ]; then break fi