1

I have suddenly the error in the subject but have no idea how to set this in VS2012. Found this answer but dont get it exact how to adjust it: Degraded allocation. Consider increasing nursery-size if the warning persists

This is my complete error code:

GC_OLD_BRIDGE num-objects 0 num_hash_entries 0 sccs size 0 init 0.00ms df1 0.00ms sort 0.00ms dfs2 0.00ms setup-cb 0.00ms free-data 0.00ms links 0/0/0/0 dfs passes 0/0 ( 2042): GC_MINOR: (Nursery full) pause 50.59ms, total 50.64ms, bridge 0.08ms promoted 384K major 624K los 0K ( 2042): GC_OLD_BRIDGE num-objects 0 num_hash_entries 0 sccs size 0 init 0.00ms df1 0.00ms sort 0.00ms dfs2 0.00ms setup-cb 0.00ms free-data 0.00ms links 0/0/0/0 dfs passes 0/0 ( 2042): GC_MINOR: (Nursery full) pause 52.03ms, total 52.16ms, bridge 0.13ms promoted 0K major 624K los 0K ( 2042): Warning: Degraded allocation. Consider increasing nursery-size if the warning persists.

Can somebody help me out on this?

Thanks

Community
  • 1
  • 1
user3763117
  • 327
  • 1
  • 5
  • 18

1 Answers1

1

You can bump up Monos GC nursery size by changing the environment settings for your application.

To do so, right click on your solution and add a text file called environment.txt. Then right click on this file, go to Build Action and set it to AndroidEnvironment.

enter image description here

In this file, add the following text:

MONO_GC_PARAMS=nursery-size=16m

This will configure the nursery size to 16 megabytes (which is huge). Here are some links that document this file:

Community
  • 1
  • 1
matthewrdev
  • 11,930
  • 5
  • 52
  • 64
  • Hi Matt, thank you for your answer, but I am using VS2012 is there anyway to do this with VS or with scripting or something? – user3763117 Feb 23 '15 at 09:14
  • Just out of curiosity, I have tried to find out what this error generated and when I commented out "base.OnCreate(bundle);" the C# code started to run again without errors, so what and where does this nursery is being usefull for, only forms? – user3763117 Feb 23 '15 at 09:24
  • The nursery is a memory chunk reserved for garbage collection where small objects are allocated to initially. It isn't limited to forms, it holds all small allocations (like objects, arrays etc). I'm a bit too sleepy to explain it in-depth so I'd recommend reading the SGen docs for a thorough explanation of Monos garbage collection implementation. http://www.mono-project.com/docs/advanced/garbage-collector/sgen/ – matthewrdev Feb 23 '15 at 11:22
  • Thanks for the explaination, I read the doc already in the weekend however did not really understood the purpose. Than again I am new to android development ;) Thanks for your help, well appriciated – user3763117 Feb 23 '15 at 19:04