question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

OutOfMemoryException when building Xamarin project

See original GitHub issue
Internal 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:closed
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
rgroenewoudtcommented, Oct 30, 2019

Lately I haven’t had any issues anymore.

0reactions
rgroenewoudtcommented, Feb 4, 2019

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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found