Re:Dealing with Out-of-Memory Conditions in Rust
by jbverschoor on Saturday August 14, 2021 @06:00PM
(#28184282)
Misunderstood.. didn’t see the part that it’s just for handling it.
I thought you were talking about just allocation a huge chinch of mem
Re:Dealing with Out-of-Memory Conditions in Rust
by zbentley on Saturday August 14, 2021 @10:25PM
(#28185759)
Nope, just crash ballast. I understand what you're condemning though: it's super regrettable when ordinary utilities, daemons, or desktop apps preallocate like like they're database servers on dedicated hardware.
This is absolutely not why Java had/has a bad rap memory wise--that has more to do with a combination of code that allocates irresponsibly on the happy (not memory-error-anticipating) path, and the JVM's preference to preallocate as much as possible for every purpose, not just OOM handling.
> Just make use of proper libraries that will invalidate caches if needed
What if I've dumped every cache I can and I'm still getting allocation (or spawn, or whatever) errors because the system is out of memory? It's useful to have a contingency in place to turn out the lights room-by-room rather than cutting power to the whole building, as it were.