Nice! As the FunctionTemplate docs say, if you're gonna make lots of closures -- don't - use scripts instead.
My solution to this issue was to not rely on so many closures. I created another layer which creates concrete functions (via FunctionTemplate), and these functions know how to retrieve data for each object (essentially doing what closures were doing). On Thursday, 29 August 2019 12:13:06 UTC-4, [email protected] wrote: > > > > пятница, 19 июля 2019 г., 16:48:44 UTC+3 пользователь [email protected] > написал: >> >> I'm not sure - I'm probably leaking native resources somewhere, but those >> shouldn't blow the v8 heap. >> >> I tried looking into what noscript_shared_function_infos is (it's a >> weakarrayList) which should get compacted at GC time. So it looks like the >> functions are staying alive and either need to be manually destroyed, >> equivalent to: >> >> f = function() { //do something } >> .... >> f = null; >> or created in a way that is tied to the lifecycle of the object >> > > > I have exactly same memory leak. > All what I've done is: "Creating new context from ObjectTemplate(saved in > isolate internals) -> Bind & Run UnboundScript -> Execute some functions -> > Destroying Context" > > [image: Screenshot from 2019-08-29 19-12-08.png] > -- -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev --- You received this message because you are subscribed to the Google Groups "v8-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/v8-dev/08e9605c-49a3-4388-abff-fedf3c7d88e5%40googlegroups.com.
