Is there a limit of stack size of a process in linux

前端 未结 4 779
暖寄归人
暖寄归人 2020-12-06 01:42

Is there a limit on the stack size of a process in Linux? Is it simply dependent on the RAM of the machine? I want to know this in ord

4条回答
  •  广开言路
    2020-12-06 02:04

    The stack is normally limited by a resource limit. You can see what the default settings are on your installation using ulimit -a:

    stack size              (kbytes, -s) 8192
    

    (this shows that mine is 8MB, which is huge).

    If you remove or increase that limit, you still won't be able to use all the RAM in the machine for the stack - the stack grows downward from a point near the top of your process's address space, and at some point it will run into your code, heap or loaded libraries.

提交回复
热议问题