3 ms·
Reference counting isn't inherently more predictable than tracing garbage collection. Take the example where your thread is the last one to deref a gigantic obj
by jmgao 9y ago
Reference counting isn't inherently more predictable than tracing garbage collection. Take the example where your thread is the last one to deref a gigantic object graph. You're stuck holding the bag on traversing the entire graph and destructing it all at once, when a tracing gc could do it piecemeal (and on a dedicated background thread, instead of on your real worker threads).
- derefr 9y agoIf objects that hit zero refs have their reference pushed into the queue of a dedicated GC thread, is that not still called RC, or is that called something else?
- papaf 9y agoResearchers tend to call them Reference Counted Garbage Collectors. Here is a random example that actually recommends the opposite (RC in old generations, mark and sweep in the young generation): https://link.springer.com/chapter/10.1007/3-540-36579-6_14 https://link.springer.com/chapter/10.1007/3-540-36579-6_14