diff --git a/Launcher/runtime/dialog/overlay/settings/settings.js b/Launcher/runtime/dialog/overlay/settings/settings.js index d49d48bd..1ea44f04 100644 --- a/Launcher/runtime/dialog/overlay/settings/settings.js +++ b/Launcher/runtime/dialog/overlay/settings/settings.js @@ -29,9 +29,9 @@ var settingsClass = Java.extend(LauncherSettingsClass.static, { setRAM: function(ram) { if (ram>762&&ram<1024){ - settings.ram = java.lang.Math["min(int,int)"](ram, FunctionalBridge.getTotalMemory()); + settings.ram = java.lang.Math["min(int,int)"](ram, FunctionalBridge.getJVMTotalMemory()); }else{ - settings.ram = java.lang.Math["min(int,int)"](((ram / 256) | 0) * 256, FunctionalBridge.getTotalMemory()); + settings.ram = java.lang.Math["min(int,int)"](((ram / 256) | 0) * 256, FunctionalBridge.getJVMTotalMemory()); } }, }); diff --git a/Launcher/src/main/java/ru/gravit/launcher/client/FunctionalBridge.java b/Launcher/src/main/java/ru/gravit/launcher/client/FunctionalBridge.java index 3b1acf9c..f055ebda 100644 --- a/Launcher/src/main/java/ru/gravit/launcher/client/FunctionalBridge.java +++ b/Launcher/src/main/java/ru/gravit/launcher/client/FunctionalBridge.java @@ -3,6 +3,7 @@ import javafx.concurrent.Task; import ru.gravit.launcher.HWID; import ru.gravit.launcher.LauncherAPI; +import ru.gravit.launcher.guard.LauncherGuardManager; import ru.gravit.launcher.hasher.FileNameMatcher; import ru.gravit.launcher.hasher.HashedDir; import ru.gravit.launcher.hwid.OshiHWIDProvider; @@ -79,6 +80,24 @@ public static long getTotalMemory() { return hwidProvider.getTotalMemory() >> 20; } + @LauncherAPI + public static int getClientJVMBits() + { + return LauncherGuardManager.guard.getClientJVMBits(); + } + @LauncherAPI + public static long getJVMTotalMemory() + { + if(getClientJVMBits() == 32) + { + return Math.min(getTotalMemory(),1536); + } + else + { + return getTotalMemory(); + } + } + @LauncherAPI public static HasherStore getDefaultHasherStore() { return HasherManager.getDefaultStore();