Garbage collection and MM
Posted Mar 13, 2007 19:24 UTC (Tue) by pimlott
In reply to: Garbage collection and MM
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.
to post comments)