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
Question, crashes, x86, .net8 and largeaddressaware #1463
I manually load coreclr 8.x.x in unmanaged x86 app compiled with largeaddressaware flag. So the process is able to use the memory above 0x80000000 (2GB).
In general, works fine, however...
Sometimes the app throws out of memory exception, for example when loading 50MB managed DLL. In such a situation VMMap shows that allocated pages occupy no more than 1.6GB. I assume I still have at least 1.0GB of free memory available, even if memory below 0x80000000 is fragmented. So why it throws?
// memory status check
GC.Collect();
GC.WaitForPendingFinalizers();
GC.Collect();
long availableMemory = GC.GetTotalMemory(false);
Console.WriteLine($"Available managed memory: {availableMemory / (1024 * 1024)} MB");
// memory organize before load large assembly
GC.Collect();
GC.WaitForPendingFinalizers();
//based on stream
using (var stream = File.OpenRead("large-assembly.dll"))
{
var assembly = Assembly.Load(stream.ToArray());
}
//I'll recommand migration x64
<PropertyGroup>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
I think, it would be a good idea to migrate x64... ( the fundamental solution is )
I know there're other ways to set up a memorymap.
I hope this helps... thank you
Activity
hundong2 commentedon Jun 26, 2025
I think, it would be a good idea to migrate x64... ( the fundamental solution is )
I know there're other ways to set up a memorymap.
I hope this helps... thank you