Memory leaks discussion #2286
Unanswered
savelichalex
asked this question in
Q&A
Replies: 1 comment 14 replies
-
could you try latest alpha release to reproduce this? |
Beta Was this translation helpful? Give feedback.
14 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi guys. I've experienced huge memory leaks with [email protected] , I've been digging into a problem for almost a week, and still can't find a root cause.
So, I've tried to locate the problem with a simple component, but it seems that the problem persist in more complicated ones. (I even draw a huge memory graph to identify loops, but for simple case it all looks safe and sound).
I've been looking into the problem with Instruments, and I want to share my measures.

This is a mount of one of our complicated components:
And this is what happens after unmount:

I've read about GC collection there and I personally was able to catch the point of GCing things with simple debugger breakpoint in ShereableValue deconstuctor, so I know that it's necessary to wait a minute or two, so there another snapshot:

Moreover if I start to mount/unmount the same component, it seems that engine stops collection garbage from previous renders.
What worries me on this snapshots is this:

If I understand it correctly it's either worklets or host functions. What I can't understand is why there are so many of them. So it was a capture of one mount/unmount cycle, and I have around 30
useAnimatedStyle
and fewuseAnimatedReaction
in component. I can hardly imagine that it will produce more than 1k of refs.Do you guys have any ideas? Maybe I miss something? 🙏
Beta Was this translation helpful? Give feedback.
All reactions