On Fri, Apr 17, 2015 at 9:19 PM, Jane Chen <[email protected]> wrote: > On v8 3.24: > > /** > * Marks the reference to this object independent. Garbage collector is > free > * to ignore any object groups containing this object. Weak callback for > an > * independent handle should not assume that it will be preceded by a > global > * GC prologue callback or followed by a global GC epilogue callback. > */ > V8_INLINE void MarkIndependent(); > > I'd like to understand the above better. In what kind of scenario do I want > to mark a persistent handle independent? What kind of impact does it have > on GC? > > Thanks!
I think the exact meaning of 'independent' has shifted a little since 3.24. Here is my understanding of what it does in recent versions of V8: 1. It avoids the cost of object group handling. We don't use object groups in node.js but I think chromium does for DOM objects; if one DOM object in the collection is alive, then logically all are. Defining an object group lets the garbage collector take a shortcut at a cost of some processing overhead per individual handle. 2. Independent handles can be reclaimed during minor garbage collections (scavenges). Dependent handles are only reclaimed during major collections and thus remain alive longer, which is usually undesirable; I think they only become eligible for collection once the object they point to has been promoted from the new space (the nursery) to the old space. -- -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users --- You received this message because you are subscribed to the Google Groups "v8-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
