LinuxThreads - Stack size and Memory consumption
(I've already posted this one on the general forum, but this is probably more suitable).
I'm working with LinuxThreads (glibc2.3) on an Embedded system (MontaVista 3.1 distribution).
I have several problems with the threads memory consumption:
- Is there an option to limit the stack size?
If I understand correctly, in LinuxThreads, regardless of the scheduling policy, the stack size of each thread starts as 4KB and grows up to 2MB.
Is that true?
Is there a mode for a static non-growing stack?
- How do I measure the actual memory consumption of each thread?
Using ps/top/proc is problematic since it does not show the actual memory usage - because of the "copy on write principle".