Open mateusrodrigues opened 1 year ago
See https://github.com/dotnet/runtime/issues/84834. GC-related is placed in not planned right now. You may want to set DOTNET_GCgen0size=99999999 and use conservative GC mode for testing.
Apparently, it's trying to allocate 274 GB of memory if I understood this correctly?
It is trying to reserve virtual memory space of that space, not allocate that much of physical memory. This is expected, but it causes problem on RISC-V as its virtual address space is limited to 256 GB IIRC (other 64 bit platforms have limit of 32TB). Setting DOTNET_GCHeapHardLimit=3C00000000
(the value is a bit below 256GB) might also fix the problem, but maybe using the setting mentioned in the previous comment would be better since this came from the developers of the RISC-V support.
@mateusrodrigues There's already fix for this for VisionFive 1/2, please try https://github.com/dotnet/runtime/pull/84797
Description
I am investigating the current state of .NET on RISC-V and started by trying to build CoreCLR on a board. So I created a simple Hello World .NET app and tried to run it with
corerun
. I am currently getting the following error:As the error code indicates an OOM error, I ran
strace
on this and got the following output:Apparently, it's trying to allocate 274 GB of memory if I understood this correctly?
Reproduction Steps
./src/coreclr/build-runtime.sh
System.Private.CoreLib
directory with../../../.dotnet/dotnet build -r linux-riscv64 -c Debug --no-self-contained /p:PlatformTarget=AnyCpu System.Private.CoreLib.csproj
dotnet new console -o HelloWorld
2.2.dotnet build
2.3. Copied theHelloWorld.dll
file over to the board./corerun HelloWorld.dll
Expected behavior
Should output
Hello, World!
Actual behavior
Outputs the error included in the description.
Regression?
No response
Known Workarounds
No response
Configuration
corerun
built from themain
branch CoreCLRlscpu
output/etc/os-release
infoulimit -v
outputOther information
No response