Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Out of Memory in Xamarin Studio and Visual Studio for Mac #302

Closed
JCKodel opened this Issue Apr 9, 2017 · 24 comments

Comments

Projects
None yet
@JCKodel
Copy link

JCKodel commented Apr 9, 2017

When 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
@tuyen-vuduc

This comment has been minimized.

Copy link

tuyen-vuduc commented Apr 9, 2017

I also face this issue. I logged an issue on a Realm repo.

@tuyen-vuduc

This comment has been minimized.

Copy link

tuyen-vuduc commented Apr 9, 2017

Change .NET Runtime to v4.8 in Xamarin Studio/VS for Mac Preference will be a workaroud
screen shot 2017-04-09 at 6 30 43 pm

@bbkillen

This comment has been minimized.

Copy link

bbkillen commented Apr 9, 2017

kanvuduc's solution fixed my problem and saved my bacon!!!

@stefandevo

This comment has been minimized.

Copy link

stefandevo commented Apr 11, 2017

I reported this on the mono. bugzilla

@stefandevo

This comment has been minimized.

Copy link

stefandevo commented Apr 11, 2017

And now moved to jbevain/cecil#378 as Mono group is pointing to Cecil as the cause.

@stefandevo

This comment has been minimized.

Copy link

stefandevo commented Apr 11, 2017

And now Cecil is pointing to Fody again jbevain/cecil#378 (comment).

Is Fody using v0.9 or v.10 ?

@stefandevo

This comment has been minimized.

Copy link

stefandevo commented Apr 11, 2017

So I checked the latest nuget packages for Fody. 1.29.4 en 1.30.0-beta01 are coming with Mono.Cecil.dll version 0.9.6.0; so this is the problem (according to Mono.Cecil).

However, in https://github.com/Fody/Fody/tree/master/Lib/Cecil I see the that the version is 0.10.0 ...

Is it possible to create a new update for fody packaging this latest version? @SimonCropp ?

@hrach

This comment has been minimized.

Copy link

hrach commented Apr 11, 2017

Any idea for workaround in Visual Studio on Windows?

@bbkillen

This comment has been minimized.

Copy link

bbkillen commented Apr 11, 2017

@Lenndev

This comment has been minimized.

Copy link

Lenndev commented Apr 12, 2017

Pointing to each other doesn't help... what does help is the "work around" @kanvuduc mentioned. In VS > preferences > .NET runtimes > set Mono 4.8.0 as default

@hrach

This comment has been minimized.

Copy link

hrach commented Apr 12, 2017

Well, on Windows, there is not such configuration, is there a mono somewhere?

@Lenndev nobody is "pointing", people just try to find the cause and get it logged into a proper issue tracker.

@stefandevo

This comment has been minimized.

Copy link

stefandevo commented Apr 12, 2017

Fixing it for now is ok, but for example on VSforMac or XS this means you cannot use c# 7 in combination with Fody with doesn't make me happy...

@galvesribeiro

This comment has been minimized.

Copy link

galvesribeiro commented Apr 13, 2017

+1 with the same issue... Sad to hear we can't use C#7 + Fody :(

@dansiegel

This comment has been minimized.

Copy link

dansiegel commented Apr 14, 2017

It seems like this is causing major havoc for a lot of dev's... so glad it's not just me. It seems that the root of this is Cecil, however it is also a Fody problem due to the way in which Fody ships with no dependencies by including Cecil as part of the package. Supposedly the issue should be fixed in 0.10-beta5, however Fody would need to release an updated package with the new Cecil binaries.

@Redth

This comment has been minimized.

Copy link

Redth commented Apr 18, 2017

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.

@Bartmax

This comment has been minimized.

Copy link

Bartmax commented Apr 20, 2017

This is going to break any Xamarin dev using Fody very soon.

Yup, add one more to the list.
My code is full of C# 7 so no workaround for me... 😢

@renzska

This comment has been minimized.

Copy link
Contributor

renzska commented Apr 20, 2017

Sadly, like @kanvuduc mentioned, this breaks the usage of Realm. We were about to start using it in a new app, but now we have to find something else. Any recommendations besides sqllite?

@galvesribeiro

This comment has been minimized.

Copy link

galvesribeiro commented Apr 20, 2017

@renzska same case here... Thats why libraries should avoid at all cost to don't take dependencies on 3rd party libraries... It will break Realm all over...

@stefandevo

This comment has been minimized.

Copy link

stefandevo commented Apr 20, 2017

@SimonCropp

This comment has been minimized.

Copy link
Member

SimonCropp commented Apr 22, 2017

Can u try fody 2.0

@dansiegel

This comment has been minimized.

Copy link

dansiegel commented Apr 22, 2017

@SimonCropp testing this with PropertyChanged in VS for Mac everything looks like it's working right again. Thanks for getting the update out!

@SimonCropp

This comment has been minimized.

Copy link
Member

SimonCropp commented Apr 22, 2017

Good to hear

@SimonCropp SimonCropp closed this Apr 22, 2017

@SimonCropp SimonCropp reopened this Apr 22, 2017

@SimonCropp SimonCropp closed this Apr 22, 2017

@SimonCropp SimonCropp added this to the 2.0.0 milestone Apr 23, 2017

@ismly

This comment has been minimized.

Copy link

ismly commented Aug 10, 2017

@kanvuduc how can I download 4.8.0 for mac?

@tuyen-vuduc

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.