Let's address another GC misconception: that you can divide GC algorithms into "perfectly precise" ones like tracing and "imprecise" ones like reference counting without cycle collection.
2
9
1
45
In fact, all GCs use some sort of conservative heuristic. The real problem GCs are trying to solve is to identify memory the program will never use again. This is a dynamic problem, and so a truly precise solution runs up against the halting problem.
3
1
26
In some JS leaks, the program *does* use the object again, but doesn't need to. (Consider the extreme example of a cache that never evicts entries; cache lookup still examines them.)
So you could say "use again" is *still* too conservative since some future uses are unneeded.
Aug 20, 2019 · 8:36 PM UTC
1
2

