Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
- Join Date
- Apr 2006
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".
For the second problem, try with a profiler similar to valgrind. It usually throws a lot of information and deals fine with threads.
For the first question, maybe you want to send it to kernelnewbies.