On Mon, May 1, 2017 at 4:25 PM, Brendan Bates <[email protected]> wrote: >> I don't see an actual memory leak in the code you posted but creating >> a new ObjectTemplate for every query isn't very efficient. > > Just wanted to reply to this to say, that is an irrelevant point to this > discussion. Even if you are using it sparingly, if you have a long-running > script that calls NewInstance(), then > this would be a problem.
Seems relevant enough to me if you like efficient programs but I take back my words because there is a memory leak: ObjectTemplate::New() produces a template that caches instantiations. The first instantiation is cached, subsequent instantiations are cloned from that cached instance. It's not an issue when you create the ObjectTemplate once but it does become an issue when you create the ObjectTemplate afresh every time. That is a silly thing to do, though; it misses the point of templates. -- -- 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.
