3 ms·
How did you get from “garbage collection” to “excessive memory usage”?
by xigoi 3y ago
How did you get from “garbage collection” to “excessive memory usage”?
- angiosperm 3y agoYet, it is what we experience. One GC program on a machine may perform well. Two are a problem.
- xigoi 3y agoYou didn’t answer my question. Why, in general, wouid a garbage-collected language consume more memory?
- angiosperm 3y agoGC 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.
- xigoi 3y agoYou’re making a lot of assumptions about the specific GC algorithm used. Those based on reference counting clean up immediately when possible.