<div dir="ltr"><div>Hi,</div><div>I'm running the following .net program on mono (Ubuntu 12, sources 3.8.13.12)</div><div>and after ~1 minute where the memory rises up (without any reason according to the code below), mono crash with TOO MANY HEAP SECTIONS.</div>
<div>(using Queue + lock is stable)</div><div>I got mono sources from Git and compile them with large heap.</div><div>The result was the same. </div><div><br></div><div>I have a few questions:</div><div>1. Do you have any idea what could cause this problem ?</div>
<div>2. regarding mono compilation, all makefiles created are with -g flag, how can I remove it ?</div><div><br></div><div>Thanks</div><div>Natti</div><div><br></div><div><br></div><div><br></div><div>class Program<br>{<br>
    private static readonly ConcurrentQueue<object> Pool = new ConcurrentQueue<object>();<br>    static void Main(string[] args)<br>    {<br>        //Fill<br>        for (var i = 0; i < 500; i++)<br>            Pool.Enqueue(new object());</div>
<div>        var threads = Enumerable.Range(0, Environment.ProcessorCount)</div><div>                                                 .Select(_ => new Thread(() =><br>                                                  {<br>
                                                          while (true)<br>                                                          {<br>                                                                  object obj;<br>                                                                   if (Pool.TryDequeue(out obj))<br>
                                                                       Pool.Enqueue(obj);<br>                                                           }<br>                                                    })).ToArray();<br>
                foreach (var t in threads)<br>                      t.Start();</div><div>                Thread.Sleep(Timeout.Infinite);<br>            }<br>     }<br>}<br></div><div><br></div><div><br></div><font face="Consolas"><font face="Consolas"><div>
 </div>
</font><div></div></font><div></div></div>