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
what's worse is that if I call myModule.makeBlockWrapper(() => {}) using Context api from java code, gc print message one less than it should be.
this code block seems to work as expected,
calling like below collect and print message as expected.
context.eval("js", """ const myModule = require('uv_file_convert'); for (let i = 0; i < 5; i++) { const coo = myModule.makeBlockWrapper(() => {}) console.log(i) coo.close(); } foo.close() gc();""".trimIndent())
}
but if I extract the object into polygot in seems not to recognize the unreferencing.
val wrappedValue = context.eval("js", """ const myModule = require('uv_file_convert'); myModule.makeBlockWrapper(() => {})""".trimIndent())
wrappedValue.invokeMember("close")
context.eval("js", """ for (let i = 0; i < 5; i++) { const coo = myModule.makeBlockWrapper(() => {}) console.log(i) coo.close(); } foo.close()// deinit and deinit 22 is called only 5 times gc();""".trimIndent())
It seems GraalVM under nodeJS does not garbage collect native object well.
I have simple Node-addon-api base native addon which create Napi::ThreadSafeFunction to use in JVM
I had to build this against standard NodeJS, since GraalVM+NodeJS does not expose library to link with (see oracle/graal#7063 ).
If I execute javascript with --expose-gc on Node output is different between normal NodeJS and Graal. REPL
NodeJS
GraalJS
what's worse is that if I callmyModule.makeBlockWrapper(() => {})
using Context api from java code, gc print message one less than it should be.this code block seems to work as expected,
The text was updated successfully, but these errors were encountered: