3 ms·
No, I understand how Loom limits the amount of stuff on the stack. Its just I thought threads always had those large stacks. Based on what the top person said,
by emccue 4y ago
No, I understand how Loom limits the amount of stuff on the stack. Its just I thought threads always had those large stacks.
Based on what the top person said, I'm thinking that they don't get a large stacks until they cross some threshold of use, but I want to make sure.
- vlovich123 4y agoStacks are allocated statically upfront. However, you can change the size the kernel allocates, you can point them to use a custom memory space instead of the default one and you can change the stack you're running on. Also, like all memory pages, stack space isn't actually allocated until you modify it so if your stack depth doesn't get crazy large/you're not storing large objects on the stack, it's possible your 16 MB stack is only using 1 MB or so of real RAM.