SUMMARY: pthread_create: out of space

From: Stephen Campbell <steve_at_avalon.dartmouth.edu>
Date: Wed, 22 Nov 1995 08:19:19 -0500

My original posting was:

> We have a multi-threaded application running under DEC Unix version 3.2.
> It's a classic server, and each request causes a new thread to be created.
> Threads typically live for 5 to 10 minutes; never more than 20. As soon as
> a thread is created, it is pthread_detached by the main loop. On a normal
> day there may be 20,000 requests (threads) created and terminated. At busy
> periods of the day, we typically see 250 or 300 threads active at a time.
>
> Under peak load, we often see pthread_create failing with errno = ENOMEM.
> We can't figure out why. We have searched in vain for a traditional memory
> leak (though we might have missed one). The overall size of the process does
> not seem excessive; it might reach 20MB as shown by 'ps l'. Our sysconfigtab
> has the following:
>
> proc:
> per-proc-stack-size = 4194304
>
> which we think is large enough. The machine has 128MB of real memory, and
> though it does a number of other functions (heavy sendmail, ftpd, etc) it does
> not seem to critically short of swap space as shown by swapon -s.
>
> We would be interested in any hints as to why this application is running out
> of space.

Thanks to all who responded. The definitive answer came from Pierre Wendling
(wendling_at_vbo.dec.com) and Vipin Gokhale (VGOKHALE_at_us.oracle.com). Quoting
Wendling:

 This error is produced because you don't have enough entry in a table for
 the server process. You need to increase the vm-mapentries in the vm section
 of the /etc/sysconfigtab, default is 200 (you may create a little bit less
 than 200 threads per process ), you may need to increase it up to 400 to
 support the 300 active threads)

We increased the value from the default 200 to 500, and the problem stopped.

I also want to give a tip of the hat to DEC for the sysconfig capability.
It makes kernel tuning a lot easier.

                                                Steve Campbell
Received on Wed Nov 22 1995 - 14:51:05 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:46 NZDT