Alex Rivera | Logout

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

Asked 2010-04-17T00:18:43.373
21

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 order to limit the depth of recursive calls to a function.

Edit
Report

1 Answer

6

The limit can be set by the admin.

See man ulimit.

There is probably a default which you cannot cross. If you have to worry about stack limits, I would say you need to rethink your design, perhaps write an iterative version?

answered 2010-04-17T00:27:52.670

Your Answer