@@ -1749,6 +1749,14 @@ val pklArgs: List<String> = listOf(
17491749
17501750val defaultPlatformArgs: List <String > = listOf ()
17511751
1752+ val overrideCpus = (findProperty(" dev.elide.native.cpus" ) as String? )
1753+ ?.toIntOrNull()
1754+
1755+ val overrideRam: String? = (findProperty(" dev.elide.native.xmx" ) as String? )
1756+
1757+ fun nativeBuildCpus (default : Int ): Int = overrideCpus ? : default
1758+ fun nativeBuildRam (default : String ): String = overrideRam ? : default
1759+
17521760val windowsOnlyArgs = defaultPlatformArgs.plus(listOf (
17531761 " --gc=$effectiveGc " ,
17541762 " -R:MaximumHeapSizePercent=80" ,
@@ -1757,7 +1765,8 @@ val windowsOnlyArgs = defaultPlatformArgs.plus(listOf(
17571765) else listOf (
17581766 " -Delide.vm.engine.preinitialize=false" ,
17591767)).plus(if (project.properties[" elide.ci" ] == " true" ) listOf (
1760- " -J-Xmx48g" ,
1768+ " -J-Xmx${nativeBuildRam(" 48g" )} " ,
1769+ " --parallelism=${nativeBuildCpus(Runtime .getRuntime().availableProcessors())} " ,
17611770) else emptyList())).plus(if (oracleGvm) listOf (
17621771 // disabled on windows
17631772 " -H:-AuxiliaryEngineCache" ,
@@ -1787,7 +1796,8 @@ val darwinOnlyArgs = defaultPlatformArgs.plus(listOfNotNull(
17871796) else listOf (
17881797 " -Delide.vm.engine.preinitialize=false" ,
17891798)).plus(if (project.properties[" elide.ci" ] == " true" ) listOf (
1790- " -J-Xmx12g" ,
1799+ " -J-Xmx${nativeBuildRam(" 64g" )} " ,
1800+ " --parallelism=${nativeBuildCpus(Runtime .getRuntime().availableProcessors())} " ,
17911801) else listOf (
17921802 " -J-Xmx64g" ,
17931803 " --parallelism=12" ,
@@ -1864,10 +1874,11 @@ val linuxOnlyArgs = defaultPlatformArgs.plus(
18641874 " -Delide.vm.engine.preinitialize=true" ,
18651875 ) else emptyList())
18661876).plus(if (project.properties[" elide.ci" ] == " true" ) listOf (
1867- " -J-Xmx64g" ,
1877+ " -J-Xmx${nativeBuildRam(" 64g" )} " ,
1878+ " --parallelism=${nativeBuildCpus(Runtime .getRuntime().availableProcessors())} " ,
18681879) else listOf (
1869- " -J-Xmx64g " ,
1870- " --parallelism=32 " ,
1880+ " -J-Xmx ${nativeBuildRam( " 64g " )} " ,
1881+ " --parallelism=${nativeBuildCpus( 32 )} " ,
18711882))
18721883
18731884val linuxGvmReleaseFlags = listOf<String >()
0 commit comments