3 ms·
You can absolutely create memory leaks in Rust [1]. That's a bigger problem for server applications than CPU / Memory performance issues, because the latter ca
by koheripbal 6y ago
You can absolutely create memory leaks in Rust [1].
That's a bigger problem for server applications than CPU / Memory performance issues, because the latter can be traced more easily.
As a (mediocre) dev and head of a team (some are great, and some are as bad as me), I'm far more worried about bugs than performance.
[1] https://stackoverflow.com/questions/55553048/is-it-possible-to-cause-a-memory-leak-in-rust https://stackoverflow.com/questions/55553048/is-it-possible-...
- ragnese 6y agoDepends what we're talking about. A "true" memory leak (as in allocated memory that is not referenced) is not very likely. A reference cycle with `Arc`s can happen though. But if you're talking about Java and mediocre devs (I'm in the club- don't worry), I feel like there are no shortage of ways to make bugs with null, concurrency issues, etc, that Rust completely eliminates. You can make reference cycles in Rust, though. Also, in Rust code you often don't have references to references to references the way you do in Java, so it's just not an issue that I'm aware of having had yet.
- koheripbal 6y agohttps://stackoverflow.com/questions/55553048/is-it-possible-to-cause-a-memory-leak-in-rust https://stackoverflow.com/questions/55553048/is-it-possible-...
- estebank 6y agoThat SO answer restates what the parent said: you can leak data either explicitly (Box::leak/std::mem::forget) or by creating reference cycles when using Arc/Rc.