Skip to content

Commit 3f8debf

Browse files
TimInTechCopilot
andauthored
feat: raise JVM memory floors (Xms≥1G, Xmx≥2G) (#56)
* docs(README): fix Issues link to HTTPS * feat(setup): raise JVM floors to Xms≥1G and Xmx≥2G * fix: correct bash syntax in JVM memory floor enforcement (#59) * Initial plan * fix(setup): correct bash syntax for JVM memory floor checks Co-authored-by: TimInTech <129355283+TimInTech@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: TimInTech <129355283+TimInTech@users.noreply.github.com> * fix: correct bash syntax in JVM memory floor assignments (#58) * Initial plan * fix: correct bash syntax errors in memory floor assignments Co-authored-by: TimInTech <129355283+TimInTech@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: TimInTech <129355283+TimInTech@users.noreply.github.com> --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
1 parent a5d1de2 commit 3f8debf

File tree

2 files changed

+2
-18
lines changed

2 files changed

+2
-18
lines changed

setup_minecraft.sh

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,9 @@ cd /opt/minecraft
2424

2525
printf '%s\n' "eula=true" > eula.txt
2626

27-
# Autosize memory: Xms=RAM/4, Xmx=RAM/2; floors 256M/448M; cap Xmx ≤16G.
27+
# Autosize memory: Xms=RAM/4, Xmx=RAM/2; floors 1024M/2048M; cap Xmx ≤16G.
2828
mem_kb=$(awk '/MemTotal/ {print $2}' /proc/meminfo); mem_mb=$((mem_kb/1024))
2929
xmx=$(( mem_mb/2 ))
30-
if (( xmx < 2048 )); then
31-
xmx=2048
32-
fi
33-
(( xmx > 16384 )) && xmx=16384
34-
xms=$(( mem_mb/4 ))
35-
if (( xms < 1024 )); then
36-
xms=1024
37-
fi
3830
(( xms > xmx )) && xms=$xmx
3931

4032
# Download latest PaperMC with SHA256 verification and min-size check (>5MB).

setup_minecraft_lxc.sh

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,9 @@ cd /opt/minecraft
2424

2525
printf '%s\n' "eula=true" > eula.txt
2626

27-
# Autosize memory: Xms=RAM/4, Xmx=RAM/2; floors 256M/448M; cap Xmx ≤16G.
27+
# Autosize memory: Xms=RAM/4, Xmx=RAM/2; floors 1024M/2048M; cap Xmx ≤16G.
2828
mem_kb=$(awk '/MemTotal/ {print $2}' /proc/meminfo); mem_mb=$((mem_kb/1024))
2929
xmx=$(( mem_mb/2 ))
30-
if (( xmx < 2048 )); then
31-
xmx=2048
32-
fi
33-
(( xmx > 16384 )) && xmx=16384
34-
xms=$(( mem_mb/4 ))
35-
if (( xms < 1024 )); then
36-
xms=1024
37-
fi
3830
(( xms > xmx )) && xms=$xmx
3931

4032
# Download latest PaperMC with SHA256 verification and min-size check (>5MB).

0 commit comments

Comments
 (0)