From 8cd79f9f805652f851233267f498c97cee0e0109 Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Tue, 7 Jul 2020 16:50:13 +0200 Subject: [PATCH] [platform] more educated guess on heap size for updater on x86 runtime, overridable (IDEA-242558) GitOrigin-RevId: bcd74b9f89a83e4f8c4db888adf5311a4309f794 --- .../intellij/openapi/updateSettings/impl/UpdateInstaller.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateInstaller.kt b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateInstaller.kt index 2db106544e5e..57e21eef892e 100644 --- a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateInstaller.kt +++ b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateInstaller.kt @@ -176,8 +176,10 @@ internal object UpdateInstaller { } } + val mx = System.getProperty("idea.updater.heap")?.toInt() ?: if (SystemInfo.is32Bit) Runtime.getRuntime().maxMemory() shr 20 else 2000 + args += File(java, if (SystemInfo.isWindows) "bin\\java.exe" else "bin/java").path - args += if (SystemInfo.is32Bit) "-Xmx1700m" else "-Xmx2000m" + args += "-Xmx${mx}m" args += "-cp" args += arrayOf(patchFiles.last().path, log4jCopy.path, jnaCopy.path, jnaUtilsCopy.path).joinToString(File.pathSeparator)