How can I permanently change the stack size in WSL2 Ubuntu? I can temporarily change the size with:
ulimit -s unlimited
But that only lasts till the session is closed. I have tried adding these lines to /etc/security/limits.conf
:
* soft stack unlimited
* hard stack unlimited
But that does not change the stack limit as reported by ulimit -a
.
I can call ulimit -s unlimited
in .bashrc
, but that won't work for non-interactive shells.
Strangely, if I su
to my own user with su user
, the stack appears as unlimited! It is only when I open the shell where it appears to have some default of 8192.
limits.conf
?limits.conf
.