From 5d9a6d2352e1df268a591320ac36ed62b71f8c91 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Wed, 26 Jun 2024 23:24:28 +0200 Subject: [PATCH] Try to reduce number of parallel AOT compilations To check whether it will improve memory issues on CI --- src/tasks/AotCompilerTask/MonoAOTCompiler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tasks/AotCompilerTask/MonoAOTCompiler.cs b/src/tasks/AotCompilerTask/MonoAOTCompiler.cs index 2dc46b0c65a73..b439f650385d3 100644 --- a/src/tasks/AotCompilerTask/MonoAOTCompiler.cs +++ b/src/tasks/AotCompilerTask/MonoAOTCompiler.cs @@ -523,7 +523,7 @@ private bool ExecuteInternal() } else { - int allowedParallelism = DisableParallelAot ? 1 : Math.Min(_assembliesToCompile.Count, Environment.ProcessorCount); + int allowedParallelism = DisableParallelAot ? 1 : Math.Min(_assembliesToCompile.Count, Math.Max(1, Environment.ProcessorCount/2)); if (BuildEngine is IBuildEngine9 be9) allowedParallelism = be9.RequestCores(allowedParallelism);