[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Cannot create more than 32K threads?

Yes, that's it.  Actually I have to change MAX_MAP_COUNT in
include/linux/sched.h and recompile the 2.5.70 kernel because it doesn't
have such a sysctl file.  After doubling the value from 65536 to 131072,
I can create 65530 thread before it fails with ENOMEM.  

BTW, the system begins thrashing at around 63000 threads, where resident
set of the process is around 250MB.  This makes sense to me because each
empty thread actually uses the first 4K page in its 16K stack.  Given
the system has 1GB of physical memory.  The kernel memory each thread
uses seems to be around 12KB ((1GB-250MB)/63000).

- Feng Zhou

On Mon, 2003-08-11 at 02:29, Ingo Molnar wrote:
> On Fri, 7 Aug 2003, Feng Zhou wrote:
> > I was using the 'thread-limit' program from
> > http://people.redhat.com/alikins/tuning_utils/thread-limit.c to test the
> > number of threads it could create.  It seems that it was always hitting
> > some limit at 32K threads (cannot create thread 32762, to be exact). The
> > error is ENOMEM.  Here's the kernel/ulimit settings,
> what is the current value of your /proc/sys/vm/max_map_count tunable? Can
> you max out RAM if you double the current limit?
> 	Ingo

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]