2 ms·
A GC does prevent leaking any unreachable objects, which is as good as it gets. Sure, if you store strong references to everything, nothing can be done, but th
by kaba0 4y ago
A GC does prevent leaking any unreachable objects, which is as good as it gets.
Sure, if you store strong references to everything, nothing can be done, but that’s a trivially debuggable problem.
- flohofwoe 4y ago...which is also the most likely reason for a memory leak when you manage your memory through refcounting (or rather: with refcounting, memory leaks are just as unlikely as with a GC). But even without both, these days (with memory debuggers and profilers integrated into IDEs) pretty much all memory related problems are 'trivially debuggable', this stuff isn't as scary anymore as it was 20 years ago (e.g. Xcode's Instruments has a leak detector which lets you click on the line of code which caused a memory leak, and Visual Studio has similar features).
- kaba0 4y agoMemory leaks have never been scary in tracing GCs and they are not too scary in RC as well, though I would guess that cyclic references leaking is definitely a top 10 bug for swift and alia. Memory corruption has been/is the real issue.