Re:Rust: Dropping heavy things in another thread can make yo...
by nitrogen on Wednesday June 03, 2020 @04:19PM
(#23408148)
This thread has a lot of branches, so I am just picking one for this general reply:
I recall reading somewhere, years ago, that some OSes couldn't be relied upon to release unfreed memory when a process terminated. In those contexts, fastidious freeing would be important even in short-lived processes.
In my own C code I tend to free everything so that I get a clean trace from Valgrind and don't risk masking legitimate bugs, but I typically write long-running daemons.
Re:Rust: Dropping heavy things in another thread can make yo...
by jfkebwjsbx on Sunday May 31, 2020 @01:00AM
(#23367322)
It is bad practice if your code cannot turn on deallocation for debugging purposes or library-like usage.
Re:Rust: Dropping heavy things in another thread can make yo...
by pdimitar on Saturday May 30, 2020 @06:25PM
(#23365347)
Mostly because I look at it from the angle of one-off / general purpose / CLI programs. If one such has to run for 10-30 seconds and its memory just keeps growing and growing with the idea of throwing it all away at the end and letting the OS handle it, it might become disruptive for other programs on the machine.
For specialised apps and servers it's of course a perfectly good practice.
I don't think it's even that uncommon. I believe some HFT firms run Java with a huge amount of RAM and GC disabled, and get around it by just rebooting the software occasionally.
To me writing software like that is fair game, I don't see the point in being dogmatic about "how things should be done".