| ▲ | d3ckard 4 hours ago | |
Yes, but allocations generate ever increasing combinatorial space of possible failure modes. Static allocation requires you to explicitly handle overflows, but also by centralizing them, you probably need not to have as many handlers. Technically, all of this can happen as well in language with allocations. It’s just that you can’t force the behavior. | ||
| ▲ | kibwen 3 hours ago | parent [-] | |
Sure, but let's be clear: it's a tradeoff. If every program reserved as much memory at startup as needed to service 100% of its theoretically-anticipated usage, the amount of programs we could run in parallel would be drastically reduced. That is to say, static allocation makes OOM conditions dramatically more likely by their very nature, because programs are greedily sitting on unused memory that could be doled out to other processes. | ||