Out of Memory in Xamarin Studio and Visual Studio for Mac
See original GitHub issueWhen building a Xamarin Forms project:
Error: Fody: An unhandled exception occurred:
Exception:
Out of memory
StackTrace:
at (wrapper alloc) System.Object:AllocVector (intptr,intptr)
at Microsoft.Cci.Pdb.MsfDirectory..ctor (Microsoft.Cci.Pdb.PdbReader reader, Microsoft.Cci.Pdb.PdbFileHeader head, Microsoft.Cci.Pdb.BitAccess bits) [0x000a5] in <d39e61ae2787473a851567b860d13696>:0
at Microsoft.Cci.Pdb.PdbFile.LoadFunctions (System.IO.Stream read, System.Collections.Generic.Dictionary`2[System.UInt32,Microsoft.Cci.Pdb.PdbTokenLine]& tokenToSourceMapping, System.String& sourceServerData, System.Int32& age, System.Guid& guid) [0x00027] in <d39e61ae2787473a851567b860d13696>:0
at Mono.Cecil.Pdb.PdbReader.PopulateFunctions () [0x00008] in <d39e61ae2787473a851567b860d13696>:0
at Mono.Cecil.Pdb.PdbReader.ProcessDebugHeader (Mono.Cecil.Cil.ImageDebugDirectory directory, System.Byte[] header) [0x00048] in <d39e61ae2787473a851567b860d13696>:0
at Mono.Cecil.ModuleDefinition.ProcessDebugHeader () [0x00012] in <b5a52cab1f0046ce9f68342127787868>:0
at Mono.Cecil.ModuleDefinition.ReadSymbols (Mono.Cecil.Cil.ISymbolReader reader) [0x00015] in <b5a52cab1f0046ce9f68342127787868>:0
at Mono.Cecil.ModuleReader.ReadSymbols (Mono.Cecil.ModuleDefinition module, Mono.Cecil.ReaderParameters parameters) [0x00047] in <b5a52cab1f0046ce9f68342127787868>:0
at Mono.Cecil.ModuleReader.CreateModuleFrom (Mono.Cecil.PE.Image image, Mono.Cecil.ReaderParameters parameters) [0x00076] in <b5a52cab1f0046ce9f68342127787868>:0
at Mono.Cecil.ModuleDefinition.ReadModule (System.IO.Stream stream, Mono.Cecil.ReaderParameters parameters) [0x00028] in <b5a52cab1f0046ce9f68342127787868>:0
at Mono.Cecil.ModuleDefinition.ReadModule (System.String fileName, Mono.Cecil.ReaderParameters parameters) [0x0000a] in <b5a52cab1f0046ce9f68342127787868>:0
at InnerWeaver.ReadModule () [0x00052] in <f6f9069078364b4db60945017a527c4a>:0
at InnerWeaver.Execute () [0x00019] in <f6f9069078364b4db60945017a527c4a>:0
([Solution's Name])
It takes less than 2 seconds to crash. There is plenty of memory available:
Hardware Overview:
Model Name: iMac
Model Identifier: iMac14,2
Processor Name: Intel Core i7
Processor Speed: 4,01 GHz
Number of Processors: 1
Total Number of Cores: 4
L2 Cache (per Core): 256 KB
L3 Cache: 8 MB
Memory: 32 GB
Issue Analytics
- State:
- Created 6 years ago
- Comments:24 (3 by maintainers)
Top Results From Across the Web
How Do I Fix Visual Studio 2022 Out of Memory Issue?
When I launch the project, the overall memory load hits. This sounds to me that not visual studio is maxing out of memory...
Read more >Visual Studio for Mac Memory Consumption and Crashing
Visual Studio for Mac consumes a huge amount of memory and then becomes unresponsive. I often have to kill it because it won't...
Read more >Tips to improve performance - Visual Studio (Windows)
Learn how to optimize certain Visual Studio features that you might not be using to help improve performance.
Read more >Xamarin Profiler
There are a number of different ways to profile an application with the Xamarin Profiler, namely memory profiling and statistical sampling.
Read more >Measure memory usage in your apps - Visual Studio ...
Measure memory usage in Visual Studio (C#, Visual Basic, C++, F#) ... Tools window appears automatically unless you have turned it off.
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 Free
Top 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
Change .NET Runtime to v4.8 in Xamarin Studio/VS for Mac Preference will be a workaroud
This is going to break any Xamarin dev using Fody very soon. It looks unfortunately like this project is a bit dead. I took a quick look at merging in the upstream Cecil changes back into Fody’s fork, and it looks like maybe Cecil now includes the functionality Fody had added to their fork, so perhaps it’s possible to use Cecil as a true dependency. I may have an extended look at this over the next few days.