| ▲ | duped 3 hours ago | |||||||
> you will use 10GB to do nothing. You don't pay for stack space you don't use unless you disable overcommit. And if you disable overcommit on modern linux the machine will very quickly stop functioning. | ||||||||
| ▲ | simonask 3 hours ago | parent [-] | |||||||
The amount of stack you pay for on a thread is proportional to the maximum depth that the stack ever reached on the thread. Operating systems can grow the amount of real memory allocated to a thread, but never shrink it. It’s a programming model that has some really risky drawbacks. | ||||||||
| ||||||||