Closed richarddd closed 5 months ago
@DelSkayn I have located the issue.
When moving allocation to rust we no longer keep track of GC malloc_state as quickjs want's it. This causes the GC threshold to be ignored and js_trigger_gc
that is invoked from JS_NewObjectFromShape
no longer runs GC:
https://github.com/bellard/quickjs/blob/c6cc6a9a5e420fa2707e828da23d131d2bf170f7/quickjs.c#L1286.
The fix would be to keep track of the GC malloc_state in the rust allocator as well.
Right! That should be fixed! Will fix it in #257
Hi, I've noticed that rquickjs leaks memory when using the
rust_alloc
feature.It happens for recursive or self referencing functions, even though they are not invoked:
It does not matter which allocator is being used. I tested with system, mimalloc, snmalloc, jemalloc and they all produce the same result. Release or debug doesn't matter, nor does async, parallel or regular runtime.
Using disabling the
rust_alloc
feature fixes it.Minimum reproducible: