Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
22 changes: 15 additions & 7 deletions minecraft-java/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,21 @@ chosen file downloads through the same allowlist (Modrinth's CDN is listed).

## Memory / JVM heap

The wizard's **JVM max heap** / **JVM initial heap** fields (configSchema
`MAX_MEMORY` / `INIT_MEMORY`, defaults `2G` / `1G`) size the Java heap via
the itzg image's `-Xmx`/`-Xms` plumbing. Keep the max heap roughly **25%
below the container memory limit**: the limit only caps the cgroup — it
does not size the heap — so a heap at or above the limit gets the server
OOM-killed, and a limit far above the heap wastes RAM the JVM will never
touch.
Left empty (the default), the wizard's **JVM max heap** / **JVM initial
heap** fields (configSchema `MAX_MEMORY` / `INIT_MEMORY`) are sized
automatically to **75% of the container memory limit** — pick 8Gi of
memory and the heap becomes 6144M, and it re-tracks the limit whenever
you resize the server. The remaining 25% is headroom for non-heap JVM
memory: the limit only caps the cgroup — it does not size the heap — so
a heap at or above the limit gets the server OOM-killed, and a limit far
above the heap wastes RAM the JVM will never touch. Automatic sizing
needs gameplane ≥ 0.2.0-beta.6 (`gameplaneMinVersion` gates this bundle
accordingly).

Setting either field explicitly (e.g. `2G`, `3072M`) turns the automatic
sizing off for that field and feeds the value straight to the itzg
image's `-Xmx`/`-Xms` plumbing; keep an explicit max heap roughly 25%
below the container limit for the same reason.

## Logs (including install)

Expand Down
4 changes: 2 additions & 2 deletions minecraft-java/module.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apiVersion: gameplane.local/module/v1
name: minecraft-java
displayName: Minecraft (Java Edition)
version: 2.6.0
version: 2.7.0
game: minecraft-java
summary: Vanilla / Paper / Spigot / Bukkit / Purpur / Forge / NeoForge / Fabric / Quilt servers (itzg/minecraft-server) with a version+loader picker spanning 1.16.5–latest, per-loader mod volumes, and in-app Modrinth browse.
homepage: https://www.minecraft.net/
license: MIT
gameplaneMinVersion: 0.2.0
gameplaneMinVersion: 0.2.0-beta.6
31 changes: 20 additions & 11 deletions minecraft-java/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -519,22 +519,31 @@ spec:
type: int
default: "10"

# The itzg image passes these to the JVM as -Xms/-Xmx. They must track
# the container memory limit: the limit only caps the cgroup, it does
# NOT size the heap, so a 3Gi limit with the old hardcoded 2G heap
# wasted a gigabyte — and a limit *below* heap + JVM overhead got the
# container OOM-killed.
# The itzg image passes these to the JVM as -Xms/-Xmx. Left empty,
# the operator sizes both to 75% of the container memory limit
# (autoFromMemoryLimit — needs gameplane ≥ 0.2.0-beta.6; the
# remaining 25% is headroom for non-heap JVM memory, which is what
# keeps the cgroup from OOM-killing the server). Equal -Xms/-Xmx
# gives a fixed heap, which game servers prefer over GC-driven
# resizes.
- name: MAX_MEMORY
displayName: JVM max heap
description: >-
Java heap ceiling (e.g. 2G, 3072M). Keep roughly 25% below the
container memory limit — the JVM needs headroom for non-heap
memory, and exceeding the limit gets the server OOM-killed.
Java heap ceiling (-Xmx, e.g. 2G, 3072M). Leave empty to size it
automatically to 75% of the container memory limit — it then
tracks the limit whenever you resize the server. If you set it
yourself, keep roughly 25% below the limit: the JVM needs
headroom for non-heap memory, and exceeding the limit gets the
server OOM-killed.
type: string
default: "2G"
autoFromMemoryLimit:
percent: 75

- name: INIT_MEMORY
displayName: JVM initial heap
description: Starting heap size (-Xms). At most JVM max heap.
description: >-
Starting heap size (-Xms), at most JVM max heap. Leave empty to
match the automatic max heap (a fixed heap avoids GC resizes).
type: string
default: "1G"
autoFromMemoryLimit:
percent: 75