From 4c2d1063ec1499924e6660cc41814d432ac57692 Mon Sep 17 00:00:00 2001 From: Glavo Date: Fri, 30 Dec 2022 01:59:02 +0800 Subject: [PATCH] fix #1922: Add Xms only when the min memory is less than the max memory (#1949) --- .../main/java/org/jackhuang/hmcl/launch/DefaultLauncher.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/HMCLCore/src/main/java/org/jackhuang/hmcl/launch/DefaultLauncher.java b/HMCLCore/src/main/java/org/jackhuang/hmcl/launch/DefaultLauncher.java index 8b9dd109e..bd7bf039e 100644 --- a/HMCLCore/src/main/java/org/jackhuang/hmcl/launch/DefaultLauncher.java +++ b/HMCLCore/src/main/java/org/jackhuang/hmcl/launch/DefaultLauncher.java @@ -136,7 +136,8 @@ public class DefaultLauncher extends Launcher { if (options.getMaxMemory() != null && options.getMaxMemory() > 0) res.addDefault("-Xmx", options.getMaxMemory() + "m"); - if (options.getMinMemory() != null && options.getMinMemory() > 0) + if (options.getMinMemory() != null && options.getMinMemory() > 0 + && (options.getMaxMemory() == null || options.getMinMemory() <= options.getMaxMemory())) res.addDefault("-Xms", options.getMinMemory() + "m"); if (options.getMetaspace() != null && options.getMetaspace() > 0)