4 ms·
> 20+ years ago fits into the context ... they use a lot of memory To be fair, including the stack frame and any things the kernel needs to track them, it is a
by inetknght 3y ago
> 20+ years ago fits into the context ... they use a lot of memory
To be fair, including the stack frame and any things the kernel needs to track them, it is a lot of RAM... in 20+ years ago sizes of memory. Today, even mid-grade consumer computers come with tens of GB of RAM.
- ori_b 3y agoAnd, thankfully, newer computers have virtual memory and page tables, which means that allocating a large stack only costs one page of physical memory until you use it.
- fulafel 3y agoThis was also the case in 2002.
- deleted 3y ago[deleted]
- amelius 3y agoWhen will we see more dynamically allocated stacks? I'm still getting stack overflow errors on small problems running on my 64GB system, in various languages. This feels like how strings are allocated in old languages (like COBOL?), just fixed sizes for everything.
- gpderetta 3y agoStacks dynamically grow, but there is usually a default upper bound (typically 8MB) to catch runaway recursion and other bugs before it start trashing memory. If you really need 64GB stacks you can set that bound. But do you really need huge stacks?
- deleted 3y ago[deleted]
- amelius 3y ago> Stacks dynamically grow I think that stacks grow using pagefaults, so you might still run out of address space. I.e., you can't have two programs running where (arbitrarily) one of them consumes (nearly) all of your memory on a system where address space size equals memory size.