This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Pthread_create memory usage (pthread BUG?)


On Fri, Mar 02, 2007 at 07:18:56PM +0800, Bin Chen wrote:
> I wrote a simple program that spawn a lot of threads using pthread, 
> after ran the program the memory usage of the process increase very 
> fast, soon it become:
> 
> cat /proc/5243/status abcde.

You are using default thread stack sizes, which is derived from ulimit -s
value, typically around 8MB or 10MB.  So if you create 1024 threads, that
would need 10GB of *virtual* memory.  There are several ways how you can
decrease the thread stack size, you can google around to find it out
or just look at man pages, this list is certainly not the right place
for such questions.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]