4 ms·
That is overly conservative. A perfect garbage collector that always runs in reasonable time is provably impossible. What sambeau said is that it often holds on
by ghusbands 15y ago
That is overly conservative. A perfect garbage collector that always runs in reasonable time is provably impossible. What sambeau said is that it often holds on to [an allocation] for too long, which is true to varying extent of all garbage collectors.
To leak memory is to fail to deallocate it at all.
- gchpaco 15y ago"Leak" may be the right word for some configurations with conservative GC. A "leak-free" GC would presumably guarantee eventual collection of all dead objects, which is impossible with a conservative GC in theory, and in practice it's not especially difficult to get into a configuration with the Boehm GC where the lifetime of a dead object is infinite (usually because it doesn't move and some binary data that the GC thinks might be a pointer doesn't go away, because it's texture data or something).
- sambeau 15y agoAnd of course there are many valid programs where leaking memory is totally fine (and more performant): shell tools, cgis etc. When I write any of these, the only time I free anything is when I've had to malloc something huge.