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

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.

Leave a Comment