I forgot to mention, but we're using the same string as the expression 
passed to callFunctionOn every time, and merely passing different arguments 
and objectId each time. We expected the compiled function to be cached and 
compiled just once (AFAIK there is a compilation cache that uses the source 
string as the key)

On Monday, November 16, 2020 at 1:38:23 PM UTC+2 Ori Shoshan wrote:

> We're using Runtime.callFunctionOn at a very high rate, and the compiled 
> functions seem to be leaking -- even when using node.js' `global.gc()` or 
> `HeapProfiler.collectGarbage` to manually trigger a full GC before taking a 
> heapdump. Looking at a heapdump, there are many more "(compiled code)" 
> objects which contain the functions passed to callFunctionOn.
>
> I'm reviewing the code for callFunctionOn and the use of a v8::Local seems 
> to suggest that the function should be freed immediately after that C++ 
> scope exits, so I'm confused.
> (code can be found here - 
> https://source.chromium.org/chromium/chromium/src/+/master:v8/src/inspector/v8-runtime-agent-impl.cc;l=111;drc=d0e87c5b5ac8f1d884f5899f4b63967fea784d07;bpv=0;bpt=1
>  
> )
>
> Am I wrong? When would the functions be garbage collected in that case?
>

-- 
-- 
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/2bf27557-6e86-44e7-b3ea-3145831d11dbn%40googlegroups.com.

Reply via email to