[Mono-list] Size of thread in Mono (65MB per thread ?)

Rodrigo Kumpera kumpera at gmail.com
Sat Dec 21 17:28:48 UTC 2013


This sounds like a problem in your environment.

Mono, by default, creates threads with the default size of its environment.
If your setup uses 64mb stacks, that's on you.

What mono does in addition to pthread_create is to mprotect the last few
pages of the stack to implement a soft guard against stack overflow.

How much memory each pthread_create adds in your setup?



On Thu, Dec 19, 2013 at 5:09 AM, Nicolas Antoniazzi <
nicolas.antoniazzi at gmail.com> wrote:

> Hi,
>
> I am using Mono in a virtualized environment with 512MB of RAM.
> I made a very simple program which starts 10 threads in a loop and
> apparently, every time that I start a new thread, approximately 65MB of
> memory is used.
>
> In my case, I can run 5 threads, but for the 6th, the program crashes
> (without any exception). 150MB are already consumed without the use of any
> thread.
>
> Is it a normal behavior?
>
> Thanks!
>
> --
> Nicolas Antoniazzi
>
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-list/attachments/20131221/faa179c2/attachment.html>


More information about the Mono-list mailing list