-
-
Notifications
You must be signed in to change notification settings - Fork 996
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
馃悰 Memory leaks when calling JS functions from frame processor #1953
Comments
Interesting, nice catch! We'll try to fix that in RN Worklets soon! |
The problem here is that when we allocate data in a JSI object there is no information available for the Hermes garbage collector about the inner allocation - read more here: facebook/hermes#982 I'm unsure how this will be / can be fixed when using Hermes (JSC handles this a bit differently) to be honest.
|
馃コ After some thinking I believe I麓ve found a solution and a way forward. Thanks for reporting this @bglgwyng |
@chrfalch - I am also facing the same issue, If you could explain about your fix it would be really helpful. |
Maybe related: margelo/react-native-worklets-core#154 |
Hey - I think this issue has been fixed in VisionCamera 4.0.0. 馃コ Please try V4 and let me know if you still experience this issue;
|
What's happening?
The function created by
Worklets.createRunInJsFn
causes memory leaks, and the app gets crashed eventually.It seems that the arguments passed are not garbage collected properly. With arguments of large size, for example, the buffer of a cropped image, we can observe this behavior more easily.
I tested it also with the release build and observed the same.
Reproduceable Code
Relevant log output
Camera Device
Device
iPhone 13, iOS 16.6.1
VisionCamera Version
3.2.2
Can you reproduce this issue in the VisionCamera Example app?
Yes, I can reproduce the same issue in the Example app here
Additional information
The text was updated successfully, but these errors were encountered: