Re: Thread stack management

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

 



On Mon, 2007-01-08 at 14:38 -0800, Max rumi wrote:
> What is the size of each user thread that gets created in Linux? I
> remember it used to be 2MB for each thread created beyond the main
> thread, actually Linux used mmap to reserve 2MB of linear space in the
> address space of the process and then memory was allocated as needed.

that was the case 8 years ago ;)
the world has changed 3 times since then

>   But recently when I wrote a program with a couple of threads created
> by the pthread library and checked the memory space of the process
> with pmap and /proc/pid/maps, I noticed that 10M of space was created
> for each thread's stack. 
>  
> Has something changed and the thread stack space has increased from 2M
> to 10M?

since 1996, Linux has grown actual mature threading and now the thread
stack is determined by what you set it to via the posix api calls (and
it defaults to the stack rlimit, which apparently on your distro is 8Mb)


-- 
if you want to mail me at work (you don't), use arjan (at) linux.intel.com
Test the interaction between Linux and your BIOS via http://www.linuxfirmwarekit.org


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux