Subj : Re: GC question To : Sterling Bates From : Brendan Eich Date : Wed Jun 02 2004 10:57 pm Sterling Bates wrote: > If I understand GCing correctly, it does not attempt to free objects > that are tied to a scope (ie another object). Only if that other object is rooted, or connected via one or more properties in a reference path from a root. The garbage collector marks using depth first search on the graph of live GC-things, starting from the root set. The root set consists of roots by definition (e.g., cx->globalObject for all JSContext *cx in the runtime being GC'd), atom keys, and user-managed roots (registered by their address using JS_Add{,Named}Root). So unless the object whose root was removed was referenced by a property in a live object, or by another root, it should be GC'd after the JS_RemoveRoot -- provided the embedding runs the GC. /be .