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);