Subj : Re: Conditions for GC To : Andrew Chum From : Brendan Eich Date : Thu Jun 19 2003 10:26 am Andrew Chum wrote: > 1. Over the gcMaxBytes limit (rt->gcBytes < rt->gcMaxBytes) in jsgc.c > 2. Explicitly call JS_GC() > 3. ??? A few minutes with lxr can show the call graph paths into js_GC, but there may be more in the future (see, e.g., bug 208030). The rule to protect against the GC is to bracket non-blocking uses of the JS API with JS_BeginRequest and JS_EndRequest, and to use JS_SuspendRequest and JS_ResumeRequest around any blocking operation called from a native function or getter/setter. Also, and here I'm talking about where *not* to call the GC from your own code, not where it might be called from the engine: don't call JS_GC from a JSClass.resolve hook. /be .