Build hangs on low-memory device with many CPU cores
Steps to reproduce
I'm compiling a .NET Core solution (~40 projects) on a Raspberry Pi. This machine has 4 CPU cores, but only 1 GB of RAM.
I run dotnet build to compile my solution.
Expected behavior
I expect dotnet build to be slow, but work.
Actual behavior
What I've observed is that many dotnet processes are being launched, eating away memory, until the machine completely runs out of memory and becomes unusable.
When I run the build in a Docker container, and limit the CPUs which the container can access to 1 or 2, the build completes correctly.
It appears that dotnet build limits the concurrency when the machine is low on CPU, but not when the machine is low on memory.
Environment data
dotnet --info output:
root@da5fb4612217:/# dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 3.0.100-preview3-010431
Commit: d72abce213
Runtime Environment:
OS Name: ubuntu
OS Version: 18.04
OS Platform: Linux
RID: ubuntu.18.04-arm64
Base Path: /usr/local/dotnet/sdk/3.0.100-preview3-010431/
Host (useful for support):
Version: 3.0.0-preview3-27503-5
Commit: 3844df9537
.NET Core SDKs installed:
3.0.100-preview3-010431 [/usr/local/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.App 3.0.0-preview3-19153-02 [/usr/local/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.0.0-preview3-27503-5 [/usr/local/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
same here (aws 1gb ubuntu .net core 3.1 x86-64)
Any solutions for this?