2 ms·
I buy all the groceries I need for a week. That's realistically achievable (cost, cargo capacity of my vehicle, storage capacity at home, etc.). I buy all the
by LgWoodenBadger 4y ago
I buy all the groceries I need for a week. That's realistically achievable (cost, cargo capacity of my vehicle, storage capacity at home, etc.).
I buy all the groceries I need from now until the end of time. That's not realistically achievable, from any perspective.
Allocating all the memory you need for a day is realistically achievable. Allocating all the memory you need until the end of time is not realistically achievable.
- recursive 4y agoThe grocery analogy doesn't work. When you're "done" with a particular "grocery", it's gone. It doesn't exist anymore. When you're done using a block of memory, you can use it again and again and again. Assuming you remembered to free it. Groceries work more like write-once memory. Still sounds like a leak to me.
- TeMPOraL 4y agoIt's a "leak" only if it creates problems for you, such as slowdown or risk of running out of memory. In this case, there are no such problems - memory use and execution time are both bounded. The memory gets automatically reclaimed when the program restarts (that's the job of the OS, and if it fails at it, you can always reboot the machine). It's a perfectly fine way of engineering a system. There's also a variant of this that's been used on missiles - basically, you put enough RAM on the weapon to guarantee it'll hit its target or run out of fuel before running out of memory.