Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You're trying really hard to find a connection between implementing a GC and debugging memory leaks... and failing.

The whole freaking point of a GC like say Java's is that an average programmer can use it without having to understand how exactly it's implemented. Of course it won't hurt to know that, but it's not at all mandatory knowledge.

One just has to know which situations the GC can't cope with and avoid them. For Java there's at least one open source dedicated tool for finding leaks, it nicely explains what one needs to know.



One just has to know which situations the GC can't cope with and avoid them.

Unfortunately, many programmers believe that since Java uses garbage collection, you do not have to think about GC and ownership at all.

Oracle had to replace the fast implementation of substring that just returns a slice of a String (O(1) time) by a copying implementation (O(n)), because too many programmers do not know the basics of ownership/garbage collection and would accidentally hold on to larger strings.

Seeing the implementation details of reference counting, mark-sweep collection, and perhaps a generational collector once, makes you more aware of memory and ownership issues, even if you forget the nitty gritty details later.


You're trying really hard to find a connection between implementing a GC and debugging memory leaks... and failing.

I spent years at a vendor for a Virtual Machine. That you would compose such a sentence shows that you are ignorant of some aspects of optimization. You don't even know what you don't know, and projected that ignorance on another.

The whole freaking point of a GC like say Java's is that an average programmer can use it without having to understand how exactly it's implemented.

One of my company's most frequent consulting tasks was helping clients optimize to maximize throughput for the generational GC. That you jumped to the conclusion that I was talking about memory leaks is pretty damning.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: