Wednesday, 28 August 2013

UNIX: What should be Stack Size (ulimit -s) in UNIX?

UNIX: What should be Stack Size (ulimit -s) in UNIX?

How can I calculated the maximum Stack Size required for my program in
UNIX, so that my program never get crashed.
Suppose my program is
int main()
{
int number;
number++;
return 0;
}
1) What can be the Stack Size requried to run for this program? How it is
calculated ?
2) My Unix system gives ulimit -s 51200. Is this value 512MB really
required for my small program?
3) And what if I have a big program having Multithreads, some 500
functions, including some libraries, Macros, Dynamically allocated memory
etc. How much Stack Size is required for that ?

No comments:

Post a Comment