diff --git a/launcher/src/se/llbit/chunky/launcher/ui/ChunkyLauncherController.java b/launcher/src/se/llbit/chunky/launcher/ui/ChunkyLauncherController.java index 6d9db01901..1d4f3873b3 100644 --- a/launcher/src/se/llbit/chunky/launcher/ui/ChunkyLauncherController.java +++ b/launcher/src/se/llbit/chunky/launcher/ui/ChunkyLauncherController.java @@ -39,6 +39,7 @@ import java.awt.*; import java.io.File; import java.io.IOException; +import java.lang.management.ManagementFactory; import java.net.URL; import java.util.List; import java.util.ResourceBundle; @@ -114,7 +115,7 @@ public String getLabel(VersionInfo item) { memoryLimit.setTooltip("Maximum Java heap space in megabytes (MiB).\n" + "Limited by the available memory in your computer."); - memoryLimit.setRange(512, 1 << 14); + memoryLimit.setRange(512, getUpperMemoryLimitMb()); memoryLimit.makeLogarithmic(); memoryLimit.set(settings.memoryLimit); memoryLimit.onValueChange(value -> settings.memoryLimit = value); @@ -296,6 +297,16 @@ public void updateLauncher(Consumer errorCallback, Consumer