3 ms·
Depends 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 ha
by ragnese 6y ago
Depends 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.