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?
On Mac OS X, the default stack size for non-main threads created using pthread_create is fixed at 512KB and cannot be altered by any calls to, for example, setrlimit. This means that threads created by GRPC to handle requests have a relatively small stack size (the main thread has a 8MB stack by default).
The stack size actually allocated can grow on modern desktop operating systems. In practice it is implemented in terms of the memory management unit. As memory is accessed beyond the current committed pages of the stack, new memory pages are committed in.
The default maximum stack size of threads created in a native IIS process is 256 KB. Article. 01/24/2022.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With