Garbage collection and MM
Posted Mar 8, 2007 15:25 UTC (Thu) by
pflugstad (subscriber, #224)
In reply to:
Garbage collection and MM by aanno
Parent article:
Short topics in memory management
But as far as I understand, in many GC algorithms, there is also a 'walker' that marks memory that is not reachable any more. It is a bad idea to walk onto a swapped-out page, though.
This has not been the case for several years now. Most GCs (certainly in Java) systems use a
generational/compacting collector. As such, dead objects aren't touched at all. And this was 3+ years ago - it's gotten even better since then. When you do Java, you really do need to re-think how you program.
As someone else said, GC is everywhere these days, even embedded. The ease and clarity of developing in a GC language (Python, Perl, Java, etc), far outweigh the performance penalty you may see with GC. This is especially true for the vast majority of programs where performance is not seriously a concern, such as those with human interactions. I've done a lot C. I've done a lot of C++. I've done Python. I've done Java. I'll take Python/Java 6 days a week (but not twice on Sundays - sometimes you do need performance :-).
(
Log in to post comments)