Support jvm mem percentage (#3747)

This commit is contained in:
Leon Kampwerth
2025-11-06 13:37:23 +01:00
committed by GitHub
parent eeb62d45f9
commit 3941bd4e41
4 changed files with 76 additions and 18 deletions

View File

@@ -28,7 +28,19 @@ function buildSpigotFromSource {
mkdir ${tempDir}
cd ${tempDir}
jvmOpts="-Xms${INIT_MEMORY:-$MEMORY} -Xmx${MAX_MEMORY:-$MEMORY}"
jvmOpts=""
if isPercentage "${INIT_MEMORY:-$MEMORY}"; then
jvmOpts+="-XX:InitialRAMPercentage=$(getPercentageValue "${INIT_MEMORY:-$MEMORY}") "
else
jvmOpts+="-Xms${INIT_MEMORY:-$MEMORY} "
fi
if isPercentage "${MAX_MEMORY:-$MEMORY}"; then
jvmOpts+="-XX:MaxRAMPercentage=$(getPercentageValue "${MAX_MEMORY:-$MEMORY}")"
else
jvmOpts+="-Xmx${MAX_MEMORY:-$MEMORY}"
fi
logn ''
curl -sSL -o ${tempDir}/BuildTools.jar https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar && \