Open CYBAI opened 5 months ago
I'm investigating this with @austinried and we wonder this issue could happen because the 0.3.3 photon-node was not built with --weak-refs
so the instances are not gc-ed automatically.
However, after trying to build photon with --weak-refs --reference-types
locally, I can still reproduce the issue with same snippet.
Then, it brings us to find out the FinalizationRegistry
is not really working at the moment when it's run synchronously; related issues at https://github.com/rustwasm/wasm-bindgen/issues/3917 (and possibly https://github.com/rustwasm/wasm-bindgen/issues/3854?).
So, before the issue is fixed, photon wasm users may need to call .free()
manually to avoid memory leak.
note that we can fix the issue by calling .free()
manually.
When initializing a PhotonImage instance from base64 multiple times, it could run into memory leak status and node would be stopped due to oom exception.
In my use case, I need to initialize instances for different images but, for demo purpose, I use same image base64 here.
output: it got oom-ed around the 174 instance on my end.
Environment: