LWN.net Logo

Garbage collection and MM

Garbage collection and MM

Posted Mar 13, 2007 19:24 UTC (Tue) by pimlott (guest, #1535)
In reply to: Garbage collection and MM by ncm
Parent article: Short topics in memory management

You make a good case, but ...

Real-world programs must manage other much more limited resources -- network sockets, database connections, disks -- and any method sufficient to manage them suffices for memory as well.
comparing the problem of managing memory with managing other resources is off-base. Other resources almost always have simple, obvious lifetime rules that make explicit management straight-forward. Furthermore, there are many fewer of them (so fewer places to make mistakes, easier to audit), and errors are usually detected quickly because the resource has an externally-visible behavior. And if still explicit management is too difficult, reference counting solves the problem neatly because there are not enough objects to cause a performance impact, and there is no possibility of reference loops.

Memory management is fundamentally much harder.


(Log in to post comments)

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds