Subj : Re: JavaScript performance in the real world To : Shanti Rao From : Brendan Eich Date : Mon Sep 20 2004 02:46 pm Shanti Rao wrote: > Since SM doesn't know that it's > running out of system resources, memory needs to be recovered somehow. The engine should do a better job, but it has punted most of the work to embedders since forever, and embeddings can schedule GC well enough for most situations -- many do. > I guess that frequent GCs aren't the best way. Right. > I'm all for having the "delete" operator act immediately, since this > problem tends to happen when a single object (like a SQL result set) > owns a lot of system resources. It doesn't have to be called "delete" > either. In this case, I think the best solution is a way of telling the > ODBC driver to release the statement handles it no longer needs. That's not a memory operation at all, but a mandatory release or close call that your code must provide, and that scripts must call. Don't mix finalization up with timely release of resources, or commit of a transaction. You can't guarantee that some script (errant or evil) has not stashed a reference to the object you're trying to deallocate away somewhere. The object must remain alive till GC says it's garbage, but it certainly need not hold onto external or expensive/scarce internal resources. /be .