diff options
author | Petr Mrázek <peterix@gmail.com> | 2017-09-27 12:45:07 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2017-09-27 12:45:07 +0200 |
commit | 9a2d203c0d95e51ea02e3e62fef6289973777e84 (patch) | |
tree | 739ef893f0b803ca29652ba1afe3b2a7132e6497 /api | |
parent | 79d208795c4f1fab88caa7e1684cfbb3c37fc185 (diff) | |
download | MultiMC-9a2d203c0d95e51ea02e3e62fef6289973777e84.tar MultiMC-9a2d203c0d95e51ea02e3e62fef6289973777e84.tar.gz MultiMC-9a2d203c0d95e51ea02e3e62fef6289973777e84.tar.lz MultiMC-9a2d203c0d95e51ea02e3e62fef6289973777e84.tar.xz MultiMC-9a2d203c0d95e51ea02e3e62fef6289973777e84.zip |
GH-1993 swap min/max memory settings when they are the wrong way around
Diffstat (limited to 'api')
-rw-r--r-- | api/logic/minecraft/MinecraftInstance.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/api/logic/minecraft/MinecraftInstance.cpp b/api/logic/minecraft/MinecraftInstance.cpp index 4ff85c27..14de2f5f 100644 --- a/api/logic/minecraft/MinecraftInstance.cpp +++ b/api/logic/minecraft/MinecraftInstance.cpp @@ -305,8 +305,18 @@ QStringList MinecraftInstance::javaArguments() const "minecraft.exe.heapdump"); #endif - args << QString("-Xms%1m").arg(settings()->get("MinMemAlloc").toInt()); - args << QString("-Xmx%1m").arg(settings()->get("MaxMemAlloc").toInt()); + int min = settings()->get("MinMemAlloc").toInt(); + int max = settings()->get("MaxMemAlloc").toInt(); + if(min < max) + { + args << QString("-Xms%1m").arg(min); + args << QString("-Xmx%1m").arg(max); + } + else + { + args << QString("-Xms%1m").arg(max); + args << QString("-Xmx%1m").arg(min); + } // No PermGen in newer java. JavaVersion javaVersion = getJavaVersion(); |