I saw the stack size from / proc / pid / maps for program C in linux-64 bits. I could see the following line regarding the size of the stack.
7fffc2e14000-7fffc2e35000 rw-p 00000000 00:00 0 [stack]
I do not understand the above values. If I understand, I get the difference 135168 in decimal. But it is not close to 8 MB. Am I interpreting this wrong?
But if I type rlimit:
int main (void) { struct rlimit limit; getrlimit (RLIMIT_STACK, &limit); printf ("\nStack Limit = %ld and %ld max\n", limit.rlim_cur, limit.rlim_max); }
Output: Stack Limit = 8388608 and -1 max
I get Stack Limit = 8388608, which reaches 8 MB.
source share