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.
-
-
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 -
-
-
Oops, should be "a narrower set than the set of data the program will NOT use again".
Show this threadThanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
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.
-
Yeah, you'd need some kind of definition that involves observational equivalence. I saw something like this in a paper many years back, but I can't find it now.
End of conversation
New conversation -
-
-
How is 'reachable' narrower than 'will ever use again' ? What is not reachable cannot be used again, unless the GC is kaputt. This has nothing to do with 'dynamic'.
-
Other way around. "Not reachable" is narrower than "will never be used again".
- 5 more replies
New conversation -
-
-
So you can rephrase this as: what must you "free" (and/or assign null) to not have leaks? For tracing GC, the root(s) of the unused data structure. For refc, first the back-pointers if any, then the roots. For manual memory management, all of it, depth first :)
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Is there a "not" or "never" left out, so "This is a narrower set than the set of data the program will dynamically use again" should be something like "This is a narrower set than the set of data the program will dynamically never use again"?
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
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.