From e4d1e6246e2038e6ffb4de0d19eeb6aca1f862c5 Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Tue, 20 Jun 2023 15:58:43 +0200 Subject: [PATCH] CLI: increase default value of Xms option According to the preloader's "-measure" option, just the raw class files occupy ~50 Mb during compilation of hello world (~55 Mb for K2). So 32M is a very outdated value for Xms. This change sets it to something more reasonable to hopefully avoid unnecessary GCs and thus help with performance and potentially with OOMs (KT-58690). #KT-58690 --- compiler/cli/bin/kotlinc | 2 +- compiler/cli/bin/kotlinc.bat | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/cli/bin/kotlinc b/compiler/cli/bin/kotlinc index c200606e921..1c4106474a3 100755 --- a/compiler/cli/bin/kotlinc +++ b/compiler/cli/bin/kotlinc @@ -39,7 +39,7 @@ if $cygwin; then KOTLIN_HOME=`cygpath --windows --short-name "$KOTLIN_HOME"` fi -[ -n "$JAVA_OPTS" ] || JAVA_OPTS="-Xmx256M -Xms32M" +[ -n "$JAVA_OPTS" ] || JAVA_OPTS="-Xmx256M -Xms128M" declare -a java_args declare -a kotlin_args diff --git a/compiler/cli/bin/kotlinc.bat b/compiler/cli/bin/kotlinc.bat index 7f35c848763..3d49e7b193c 100644 --- a/compiler/cli/bin/kotlinc.bat +++ b/compiler/cli/bin/kotlinc.bat @@ -20,7 +20,7 @@ if not "%JAVA_HOME%"=="" ( ) rem We use the value of the JAVA_OPTS environment variable if defined -if "%JAVA_OPTS%"=="" set JAVA_OPTS=-Xmx256M -Xms32M +if "%JAVA_OPTS%"=="" set JAVA_OPTS=-Xmx256M -Xms128M rem Iterate through arguments and split them into java and kotlin ones :loop