Comment by xigoi

2 years ago

You didn’t answer my question. Why, in general, wouid a garbage-collected language consume more memory?

GC systems delay collecting garbage because it is unproductive overhead. For each object constructed, it is quicker to claim fresh memory than to clean up garbage and reclaim its memory. Thus, garbage accumulates, amounting to memory claimed by the process, but not storing anything useful to the program. In practice, much of the memory claimed by a GC program, most of the time, is such garbage.

  • You’re making a lot of assumptions about the specific GC algorithm used. Those based on reference counting clean up immediately when possible.