-
Notifications
You must be signed in to change notification settings - Fork 488
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory leak in the SpeedTest example (Skia.Color) #2992
Comments
is this related to facebook/hermes#982? The object is not leaking but it is seen so lightweight by the gc that it doesn't garbage collect it? Does using .dispose() on the color using the same color instance fixes the issue? |
Thanks for your quick reaction @wcandillon 🙌. The things you are pointing out make a lot of sense, especially after reading PRs like #1600. I will check the |
I have tried running the However, I might have found a way to limit the amount of time the color instance gets created on our side. This would already be a big improvement, but still, we are animating the color using reanimated's We are currently getting to the point where the os watchdog is terminating our app to free up memory. Our app is intended to run on a tablet 24/7. |
Description
We are encountering a memory leak caused by using Skia.Color. We are using a similar implementation to what is used in SpeedTest example. I have also run the speedTest example directly in our app, which gives the same result. I could unfortunately not run the speedTest example in the Skia repo to confirm it is something in our setup.
It seems to be related to this line, we found this in our implementation and the SpeedTest example:
https://github.com/Shopify/react-native-skia/blob/main/apps/paper/src/Examples/SpeedTest/SpeedTest.tsx#L299
When running the instruments tool for leaks on a release build we see the following:
If we don't animate the color and make it a Skia.Color defined outside our component everything seems to be fine.
React Native Skia Version
1.11.7
React Native Version
0.76.3
Using New Architecture
Steps to Reproduce
In our case we are animating the color of the paragraph.
Snack, Code Example, Screenshot, or Link to Repository
https://github.com/Shopify/react-native-skia/blob/main/apps/paper/src/Examples/SpeedTest/SpeedTest.tsx
The text was updated successfully, but these errors were encountered: