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.
-
-
Show this thread
-
Precise tracing GCs approximate this problem by identifying memory that is no longer *reachable* from a set of root objects. This is a narrower set than the set of data the program will dynamically use again. The difference is why you can still have leaks in e.g. JS.
Show this thread -
Reference counting approximates that set with the set of objects whose reference count is zero. Conservative tracing GC approximates it with the set of objects whose pointer address appears nowhere in memory.
Show this thread -
All GCs use some sort of conservative heuristic. We can talk about which heuristics are more precise than others, but it's incorrect to refer to tracing as establishing some sort of "ground truth". Instead, all algorithms approximate the problem.
Show this thread
End of conversation
New conversation -
-
-
What do you think of
@senderPath distinction between real GC and "conservative GC"? -
Sorry I didn’t wait for punchline at https://twitter.com/pcwalton/status/1163908019752591361?s=21 …. Still, overapproximation from unambiguous-reference roots is different from the conservative stack scanning case without full type information. As Bill Joy fretted to me in 1995, a float aliasing a ptr => no dial tone.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.