Re:Null References: The Billion Dollar Mistake
by jayd16 on Saturday January 11, 2020 @11:13PM
(#22024427)
GCs are also good at compacting heaps.
[ Parent
| on HN ]
Re:Null References: The Billion Dollar Mistake
by zozbot234 on Saturday January 11, 2020 @11:30PM
(#22024484)
Perhaps, 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.