OutOfMemoryException when building Xamarin project
See original GitHub issueInternal error during Weavable methods detection: System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.IO.File.InternalReadAllBytes(String path, Boolean checkHost)
at StitcherBoy.Weaving.Build.ReadonlyAssemblyResolver.LoadFile(String path)
at StitcherBoy.Weaving.Build.ReadonlyAssemblyResolver.ResolveFromList(IAssembly assembly, IEnumerable`1 paths)
at StitcherBoy.Weaving.Build.ReadonlyAssemblyResolver.ResolveFromReference(IAssembly assembly)
at StitcherBoy.Weaving.Build.ReadonlyAssemblyResolver.Resolve(IAssembly assembly, ModuleDef sourceModule)
at dnlib.DotNet.Resolver.Resolve(TypeRef typeRef, ModuleDef sourceModule)
at ArxOne.MrAdvice.Weaver.TypeResolver.ResolverResolve(ITypeDefOrRef typeDefOrRef)
at ArxOne.MrAdvice.Weaver.TypeResolver.DoResolve(ITypeDefOrRef typeDefOrRef)
at ArxOne.MrAdvice.Weaver.TypeResolver.Resolve(ITypeDefOrRef typeRef)
at ArxOne.MrAdvice.Weaver.AspectWeaver.ResolveTypeOrGenericDefinition(ITypeDefOrRef typeDefOrRef)
at ArxOne.MrAdvice.Weaver.AspectWeaver.IsMarker(ITypeDefOrRef typeReference, ITypeDefOrRef markerInterface)
at ArxOne.MrAdvice.Weaver.AspectWeaver.<>c__DisplayClass46_0.<IsMarker>b__0(InterfaceImpl i)
at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
at ArxOne.MrAdvice.Weaver.AspectWeaver.IsMarker(ITypeDefOrRef typeReference, ITypeDefOrRef markerInterface)
at ArxOne.MrAdvice.Weaver.AspectWeaver.CreateAdviceSelector(ReflectionNode node, WeavingContext context)
at ArxOne.MrAdvice.Weaver.AspectWeaver.GetAdviceSelector(ReflectionNode node, WeavingContext context)
at ArxOne.MrAdvice.Weaver.AspectWeaver.CreateAdviceSelector(ReflectionNode node, WeavingContext context)
at ArxOne.MrAdvice.Weaver.AspectWeaver.GetAdviceSelector(ReflectionNode node, WeavingContext context)
at ArxOne.MrAdvice.Weaver.AspectWeaver.IsIncludedByNode(MarkerDefinition markerDefinition, ReflectionNode node, WeavingContext context)
at ArxOne.MrAdvice.Weaver.AspectWeaver.<>c__DisplayClass37_1.<GetMarkedMethods>b__7(MarkerDefinition d)
at System.Linq.Enumerable.WhereListIterator`1.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at ArxOne.MrAdvice.Weaver.AspectWeaver.<>c__DisplayClass37_0.<GetMarkedMethods>b__3(<>f__AnonymousType2`2 <>h__TransparentIdentifier0)
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at ArxOne.MrAdvice.Weaver.AspectWeaver.Weave(ModuleDefMD moduleDefinition) 0
When building Xamarin project. It’s not consistent, doesn’t always happen.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Getting OutOfMemoryException in Xamarin
I would increase your build heap size. Right click your Android Project > Properties > Android Options > Advanced > Java Max Heap...
Read more >Android "OutOfMemory Exception" - Telerik UI for Xamarin
1 from Xamarin, the above exception is thrown when compiling projects with a number of references to third-party assemblies. To remedy this you...
Read more >Xamarin Android Out of Memory Build Failure
If you are still running into issues with with the build failing with an OutOfMemoryException you can try upgrading your JDK to use...
Read more >xamarin linker outofmemoryexception
Have been building and deploying (with linker enabled) an xamarin android project for a couple of hours. All of a sudden builds started...
Read more >OutOfMemoryException Class (System)
The exception that is thrown when there is not enough memory to continue the execution of a program.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Lately I haven’t had any issues anymore.
I’m seeing a cache in ReadonlyAssemblyResolver that caches the entire assembly. Perhaps limit the cache to so many MB in case of large assemblies?