You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[NativeAOT] Test_GetTotalAllocatedBytes test fails with OutOfMemoryException #119187
System.AggregateException: One or more errors occurred. (Insufficient memory to continue the execution of the program.)
---> System.OutOfMemoryException: Insufficient memory to continue the execution of the program.
at System.Threading.Thread.StartCore() + 0xd5
at Test_GetTotalAllocatedBytes.<>c__DisplayClass10_0.<TestAnotherThread>b__0() + 0x89
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread, ExecutionContext, ContextCallback, Object) + 0x8b
changed the title [-]Test_GetTotalAllocatedBytes test fails with OutOfMemoryException[/-][+][NativeAOT] Test_GetTotalAllocatedBytes test fails with OutOfMemoryException[/+]on Aug 28, 2025
This is unlikely to be a managed OOM. The code is allocating and would trigger GC. More likely we run out of 32-bit space or some other resource on OS side.
I am not sure what the test is trying to achieve by creating this many threads. If creation of the threads starves the main thread (which is supposed to set a termination flag at some point), then thread creation could continue for quite a while.
Maybe we just need a cap on number of threads created by the test. creating/joining 1000 threads could be enough to see that GetTotalAllocatedBytes works in the presence of dying threads.
This is still a regular occurrence in native AOT outerloops. JitStress runs also see this, so it may not be native AOT specific. However, I'm going to reopen this bug so that I can block this test on it.
Activity
jkotas commentedon Aug 28, 2025
The test is starting and joining threads in a tight loop:
runtime/src/tests/GC/API/GC/GetTotalAllocatedBytes.cs
Lines 113 to 124 in da52037
[-]Test_GetTotalAllocatedBytes test fails with OutOfMemoryException[/-][+][NativeAOT] Test_GetTotalAllocatedBytes test fails with OutOfMemoryException[/+]dotnet-policy-service commentedon Aug 28, 2025
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.
agocke commentedon Oct 15, 2025
@VSadov Could you take a look?
VSadov commentedon Oct 15, 2025
Very likely.
VSadov commentedon Nov 4, 2025
It is also an arm32 specific failures.
This is unlikely to be a managed OOM. The code is allocating and would trigger GC. More likely we run out of 32-bit space or some other resource on OS side.
I am not sure what the test is trying to achieve by creating this many threads. If creation of the threads starves the main thread (which is supposed to set a termination flag at some point), then thread creation could continue for quite a while.
VSadov commentedon Nov 4, 2025
Maybe we just need a cap on number of threads created by the test. creating/joining 1000 threads could be enough to see that
GetTotalAllocatedBytesworks in the presence of dying threads.Make a test scenario less stressful. (dotnet#121356)
MichalStrehovsky commentedon Feb 18, 2026
This is still a regular occurrence in native AOT outerloops. JitStress runs also see this, so it may not be native AOT specific. However, I'm going to reopen this bug so that I can block this test on it.
MichalStrehovsky commentedon Feb 19, 2026
Going to assume this is the same issue as seen in JitStress. Duplicate of #121482.