The garbage collector could not allocate 16384 bytes of memory for the main section of the heap

I run some of my C # code on Mac with Xamarin Studio and get the following error.

Error :Garbage collector could not allocate 16384 bytes of memory for major heap section. 

I tried to set an explicit limit for the managed heap and work with sGen, following this tip:
Avoid messy error reporting in Mono Cryptic

 export MONO_GC_PARAMS=max-heap-size=2g mono --gc=sgen MyProgram.exe 

But I still have the same problem.
Could you tell me how to fix this?

+8
garbage-collection c # mono xamarin
source share
1 answer

Make sure that you do not use GC Low Latency / Permanent Low Latency modes, they cause such problems, do not use batch (it is old, I think) if you do not know what you are doing. You want to stick to interactive mode most of the time. Read more about Latency modes here: https://msdn.microsoft.com/en-us/library/bb384202(v=vs.110).aspx

+1
source share

All Articles