Forum Visual Studio
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Definitely incorrect OutOfMemory exception while compiling/linking Android app

AlexKeyAlexKey USMember ✭✭

From time to time I get an exception like that while compiling/linking Android app

XALNK7000: Mono.Linker.MarkException: Error processing method: 'System.Data.DataRow System.Data.DataTable::MergeRow(System.Data.DataRow,System.Data.DataRow,System.Boolean,System.Data.Index)' in assembly: 'System.Data.dll' ---> System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.Collections.Generic.HashSet1.SetCapacity(Int32 newSize, Boolean forceNewHashCodes) at System.Collections.Generic.HashSet1.IncreaseCapacity()
at System.Collections.Generic.HashSet1.AddIfNotPresent(T value) at Mono.Linker.MethodBodyScanner.AddIfResolved(HashSet1 set, TypeReference item)
at Mono.Linker.MethodBodyScanner.AllPossibleStackTypes(MethodDefinition method)
at Mono.Linker.MethodBodyScanner.GetReferencedInterfaces(AnnotationStore annotations, MethodBody body)
at Mono.Linker.Steps.MarkStep.MarkInterfacesNeededByBodyStack(MethodBody body)
at Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body)
at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method)
at Mono.Linker.Steps.MarkStep.ProcessQueue()
--- End of inner exception stack trace ---
at Mono.Linker.Steps.MarkStep.ProcessQueue()
at Mono.Linker.Steps.MarkStep.ProcessPrimaryQueue()
at Mono.Linker.Steps.MarkStep.Process()
at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
at MonoDroid.Tuner.MonoDroidMarkStep.Process(LinkContext context)
at Mono.Linker.Pipeline.ProcessStep(LinkContext context, IStep step)
at Mono.Linker.Pipeline.Process(LinkContext context)
at MonoDroid.Tuner.Linker.Process(LinkerOptions options, ILogger logger, LinkContext& context)
at Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res)
at Xamarin.Android.Tasks.LinkAssemblies.RunTask()
at Xamarin.Android.Tasks.AndroidTask.Execute()

I don't understand out of what memory? I have 64GB and more than half is free. The app can use as much as it needs but instead it throws an exception. Sometimes rebuilding helps to resolve it, sometimes VS restarting, sometimes something else. I hope Xamarin team would like to resolve this issue once and for all.

Sign In or Register to comment.