You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using this package to marshal a lot of classes, objects, functions from the Host -> VM. Because of this, we are using a single long-lived QuickJsContext.
Our host needs to call methods on the instances of classes created inside the VM, these functions may return either simple data objects or Promise containing simple data and will use functions made available from the Host -> VM.
We have no use case for using the syncing functionality provided by this package.
It appears that because of the syncing capabilities of this package, memory is being retained by the QuickJsRuntime for each call made to the ´evalCode´ that needs to return some data.
What did I already try
Disable isHandleWrappable and isWrappable. While this appeared to work at first glance, it however doesn't work when the code is async/await. It also doesn't work when using moduleLoader.
Expected
No memory is being retained when not using the syncing capabilities.
Reproduce
memory no leak will log an increase of 948.
memory leak will log a number much higher.
If you change the amount of iterations of the arena.evalCode("globalThis.test.check()");, the memory used for the no leak scenario will remain at 948 while the leak scenario will keep on increasing for each iteration.
Issue
When having code that returns data from
VM -> Host
, the memory used will keep on increasing each time theevalCode
call is made.Additional context
We are using this package to marshal a lot of classes, objects, functions from the
Host -> VM
. Because of this, we are using a single long-livedQuickJsContext
.Our
host
needs to call methods on the instances of classes created inside theVM
, these functions may return either simple data objects orPromise
containing simple data and will use functions made available from theHost -> VM
.We have no use case for using the syncing functionality provided by this package.
It appears that because of the syncing capabilities of this package, memory is being retained by the QuickJsRuntime for each call made to the ´evalCode´ that needs to return some data.
What did I already try
Disable
isHandleWrappable
andisWrappable
. While this appeared to work at first glance, it however doesn't work when the code is async/await. It also doesn't work when using moduleLoader.Expected
No memory is being retained when not using the syncing capabilities.
Reproduce
If you change the amount of iterations of the
arena.evalCode("globalThis.test.check()");
, the memory used for the no leak scenario will remain at 948 while the leak scenario will keep on increasing for each iteration.The text was updated successfully, but these errors were encountered: