pthread_create: out of space

From: Stephen Campbell <steve_at_avalon.dartmouth.edu>
Date: Mon, 13 Nov 1995 08:21:00 -0500

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.
                                                        Steve Campbell
Received on Mon Nov 13 1995 - 15:07:27 NZDT

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