Increasing the stack limit in OS X Yosemite
One way to increase the stack size is to use ulimit:

shell&gt; ulimit -s new_size_in_kb


Just keep in mind that there seems to be a hard limit on how big the stack can be on OSX and that limit appears to be 65532 kb:

shell&gt; ulimit -s 65533
ulimit: value exceeds hard limit
shell&gt; ulimit -s 65532
shell&gt; ulimit -a | grep stack
-s: stack size (kbytes)             65532


Also ulimit -s is temporary and resets once the terminal session ends.

If you want to make sure that the stack is increased for every terminal session, you could put the ulimit -s command in your .zshrc or equivalent.