3 ms·
GCs are also good at compacting heaps.
by jayd16 7y ago
GCs are also good at compacting heaps.
- zozbot234 7y agoPerhaps, but at pretty severe cost. Your heap must be structured in a way that the tracing routine can make sense of (and the consequences of this involve considerable waste and inefficiency in practice - lots and lots of gratuitous pointer chasing), and the compacting step itself involves a lot of traffic on the memory bus that trashes your caches and hogs precious memory bandwidth. Forget it. Obligate GC is a terrible idea unless you really, really, really know what you're doing.