Why is the size of stack segment much smaller than ulimit
I've noticed that, in ubuntu 12.04 x64, all programs map stack segment to virtual address range like:
7fff0f59b000-7fff0f5bc000 rw-p 00000000 00:00 0 [stack]
Since 0xbc000 - 0x9b000 = 0x21000 = 135168, the size is much smaller than the value given by ulimit -s (8192KB)
Could you tell me why? Will stack segment grow automatically up to 8MB limit? Thank you in advance.
I found the reason. ulimit -s is just upper limit, not initial committed virtual memory for stack. It will grow. But I sill don't know how to achieve that. Just "sub rsp, size; mov [rsp], imm" does not work.
链接地址: http://www.djcxy.com/p/14096.html上一篇: 如何动态增加进程的堆栈大小
下一篇: 为什么堆栈段的大小比ulimit小得多