-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
High memory consumption causing OOM crash #828
Comments
Could you email me the animation to debug? Just to clear things up for anyone that reads this in the future, Lottie is not rendering all of the frames up front. It is rendering them as it plays. |
i met this bug too. |
2 similar comments
i met this bug too. |
i met this bug too. |
Today we released Lottie 3.4.0 which includes a new rendering engine powered by Core Animation (more details here). This new rendering engine has significantly better performance, and should resolve the performance issues folks have been encountering with the previous main thread rendering engine. Please try it out by setting the |
First of all, thank you for the library, seems like almost a perfect solution to pretty animations on iOS! 👍
This issue is a:
Which Version of Lottie are you using?
Lottie 3.0.3
What Platform are you on?
What Language are you in?
Expected Behavior
An animation should not take more than say several dozen MBs of memory.
Actual Behavior
So the problem is that we have a pretty complex animation (many layers, transparency, masks), and the duration is also quite long. The JSON has about 700 kB.
Still, when it's used on the web, it needs only about 100 MB of RAM. However, when starting an animation of the same file used on iOS, it leads to the allocation of about 2 GB of RAM, playing for a while, and then crashing due to insufficient memory.
Even when splitting the animation into 9 parts, a single part still uses about 200 MB of memory, which is quite a lot (since the whole app uses only about 100 MB).
Moreover, I noticed that changing the animation view size doesn't improve the memory consumption much (e.g. when I changed the frame to 10x10 pts, it still used about 150 MB of RAM).
Do you think it would be possible to optimize the performance, or is that impossible because of how Lottie/After Effects work? To me, �it seems that Lottie is trying to render all frames in the beginning, is that true? And if yes, would it be possible to change the rendering to happen only when it's needed (for a particular frame, or only several frames ahead)?
I believe our animator could also optimize the animation in After Effects, reduce the number of layers, transparency etc. Actually it might be nice to have some notes about possible performance implications, and how to optimize it in After Effects.
Animation JSON
I understand we're probably an edge case here, but if you'd like to look at this anyway, I'll ask if I can share at least a part of the animation with you. Will probably send to your e-mail. Otherwise we'll have to use a video format or a static image.
The text was updated successfully, but these errors were encountered: