Search code examples
macosmacos-sierrastack-size

Extend the stack size on macOS Sierra


When I try to extend the stack size on macOS Sierra using the command ulimit -s unlimited the terminal print the next message:

-bash: ulimit: stack size: cannot modify limit: Operation not permitted.

I also tried to use sudo ulimit -s unlimited but it doesn't leave me either. Anyone know something?


Solution

  • There is a hard limit for the stack size on OS X that can be seen running:

    ulimit -Hs
    

    This is the maximum you can set the stack size as. So instead of unlimited the best you can do is

    ulimit -s 65532
    

    See this question for more details.