Skip to content

Commit fff5266

Browse files
Add an option to run ILC with workstation GC (#89836)
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.
1 parent 23f7dbd commit fff5266

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,12 @@ The .NET Foundation licenses this file to you under the MIT license.
299299
DependsOnTargets="WriteIlcRspFileForCompilation;$(IlcCompileDependsOn)">
300300
<Message Text="Generating native code" Importance="high" />
301301

302-
<Exec Command="&quot;$(IlcToolsPath)\ilc&quot; @&quot;$(NativeIntermediateOutputPath)%(ManagedBinary.Filename).ilc.rsp&quot;" />
302+
<PropertyGroup>
303+
<_IlcEnvironmentVariables Condition="'$(IlcUseServerGc)' == 'false'">DOTNET_gcServer=0;$(_IlcEnvironmentVariables)</_IlcEnvironmentVariables>
304+
</PropertyGroup>
305+
306+
<Exec Command="&quot;$(IlcToolsPath)\ilc&quot; @&quot;$(NativeIntermediateOutputPath)%(ManagedBinary.Filename).ilc.rsp&quot;"
307+
EnvironmentVariables="$(_IlcEnvironmentVariables)" />
303308

304309
<!-- Trick ILLinker into not actually running -->
305310
<MakeDir Condition="$([MSBuild]::VersionLessThan('$(NETCoreSdkVersion)', '7.0.0'))" Directories="$(IntermediateLinkDir)" />

0 commit comments

Comments
 (0)