I am running a program that allocates 8 MB stacks using mmap . During testing, in order to find out how many stacks I can allocate (targeting 100,000), I see that the size of virtual memory is growing rapidly as expected, and the reserved size remains small (less than 1 GB). Then the program shuts down with Cannot allocate new fiber stack: Cannot allocate memory (Errno). Using gdbto save segfault, and then looking at htop, I found that this happens in approximately 256 GB of virtual memory.
I tried to use it prlimit --as=unlimited --rss=unlimited --memlock=unlimited --data=unlimitedat program startup, but it doesn't seem to matter.
Is there any way to increase this limit? Is it advisable to increase this limit? Is there a better way for a crystal to distribute stacks?
source
share