einot / gross

Automatically exported from code.google.com/p/gross
Other
1 stars 2 forks source link

grossd dies under Linux #71

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Under Linux Fedora Core 6 (linux kernel 2.6.22.14) grossd dies every now
and then with the following error:

Grossd shutdown with exit code 2: pthread_create Cannot allocate memory

It seems this version of Linux defaults to reserving 10 MB of stack space
per thread and on a 32-bit system the addressable memory space is exhausted
after ~300 threads - a limit that grossd seems to hit even with the default
pool_maxthreads = 100 setting.

Using pthread_attr_setstacksize to set a smaller stack per thread
effectively raises the number of threads that can be created!

Original issue reported on code.google.com by kri...@gmail.com on 23 May 2008 at 8:36

GoogleCodeExporter commented 9 years ago
Grossd doesn't use stack much (some buffers are taken from stack, but that's 
about it). I think it's perfectly safe 
to lower the value to 1MB. Even smaller value would most certainly work, but 
1MB should be enough to allow 
grossd working in a 32-bit linux system.

Attached is a patch that sets stack size to one megabyte.

Original comment by eino.tuominen@gmail.com on 23 May 2008 at 10:17

Attachments: