4 ms·
> A garbage collector for instance creates a fake reality, one in which you deal with memory as if it is unlimited and extremely fast. Actually no, GC does not
by anamax 15y ago
> A garbage collector for instance creates a fake reality, one in which you deal with memory as if it is unlimited and extremely fast.
Actually no, GC does not suggest that memory is unlimited let alone imply anything about its speed. Systems with GC will happily punish anyone who makes those assumptions, just like any other memory management scheme.
GC merely says that a given address may become available for reuse after the last identifiable reference goes away.
- pork 15y agoI think he meant that GC is a "solution" to the problem of memory management only if you consider memory to be unlimited and fast; in other cases, it incurs a penalty and isn't really a "solution". You took is comment far too literally.
- anamax 15y agoManual memory management isn't "required" - it's merely the best option in some cases. However, GC is the best option in some others. (Every memory managment mechanism, including manual and even static, has costs.) Yes, GC can be the best option for system software. No mechanism is best in all circumstances.