2 ms·
> for a reason Not really, the 8MB limit was added back in '95 from a previous limit of "essentially none"[0] with a justification of > Limit the stack by to
by masklinn 7y ago
> for a reason
Not really, the 8MB limit was added back in '95 from a previous limit of "essentially none"[0] with a justification of
> Limit the stack by to some sane default: root can always increase this limit if needed.. 8MB seems reasonable.
Developers don't generally think about their stack size, especially for single-threaded programs[1] so the defaults need to be a sweet spot of not unnecessarily big (such that you can catch unbounded recursion) but not so small that you'd segfault more than a very small fraction of all programs.
[0] https://git.kernel.org/pub/scm/linux/kernel/git/history/history.git/diff/include/linux/sched.h?h=1.3.7&id=2d52d174c910808b03474c786fc42c7c7e869bd5 https://git.kernel.org/pub/scm/linux/kernel/git/history/hist...
[1] which would be why e.g. OSX has a large main thread stack (8MB) and a relatively puny secondary thread stack (512k).