This should help fixing "docker killing container due to memory use" woes.
We could consider dropping parallelism at MSBuild level instead, but this has less of a throughput impact.
DependsOnTargets="WriteIlcRspFileForCompilation;$(IlcCompileDependsOn)">
<Message Text="Generating native code" Importance="high" />
- <Exec Command=""$(IlcToolsPath)\ilc" @"$(NativeIntermediateOutputPath)%(ManagedBinary.Filename).ilc.rsp"" />
+ <PropertyGroup>
+ <_IlcEnvironmentVariables Condition="'$(IlcUseServerGc)' == 'false'">DOTNET_gcServer=0;$(_IlcEnvironmentVariables)</_IlcEnvironmentVariables>
+ </PropertyGroup>
+
+ <Exec Command=""$(IlcToolsPath)\ilc" @"$(NativeIntermediateOutputPath)%(ManagedBinary.Filename).ilc.rsp""
+ EnvironmentVariables="$(_IlcEnvironmentVariables)" />
<!-- Trick ILLinker into not actually running -->
<MakeDir Condition="$([MSBuild]::VersionLessThan('$(NETCoreSdkVersion)', '7.0.0'))" Directories="$(IntermediateLinkDir)" />