Skip to content
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

Bad Avocado 🥑 #832

Closed
3 tasks done
geoff-davis-smule opened this issue Mar 27, 2019 · 5 comments
Closed
3 tasks done

Bad Avocado 🥑 #832

geoff-davis-smule opened this issue Mar 27, 2019 · 5 comments

Comments

@geoff-davis-smule
Copy link

geoff-davis-smule commented Mar 27, 2019

Check these before submitting:

This issue is a:

  • Crashing Bug

Which Version of Lottie are you using?

Lottie 3.0.3

What Platform are you on?

  • iOS

What Language are you in?

  • Swift

Expected Behavior

The animation file is only 102k, so not huge. We are testing Lottie by running animations in the individual cells of a large collection view, loading more as we scroll down.

Screen Shot 2019-03-27 at 11 24 38 AM

Actual Behavior

As I scroll, memory usage soars dramatically, quickly climbing up to 2GB and crashing the app. I don't see anything close to this behavior in other Lottie animations of similar size and complexity. Perhaps something in this animation file is triggering the runaway memory. I didn't create the original animation, and don't know enough yet about the bodymovin file structure to make any inferences about what's causing it, but I though you guys might want to take a look.

Code Example

If you want, I can ZIP the Xcode test project and send it to you.

Animation JSON

Download from here:
https://lottiefiles.com/4675-a-guakka-loader-for-foodvisor

Additional Random Question

Hey, if Lottie is named after Lottie Reineger, did you guys get the idea from her movies that they project on the wall in the Alchemist bar in SF?

@buba447
Copy link
Collaborator

buba447 commented Mar 28, 2019

Can you send the project for debugging?

RE: Lotte Renninger (not Lottie Renninger). It is named after her, but I have not seen her Animations playing at the Alchemist. I did a paper on her in my history of animation class in college. Her story has always stuck with me so I named the library after her.

@geoff-davis-smule
Copy link
Author

geoff-davis-smule commented Mar 28, 2019

Hey,

Here's the project. I had called it "Reiniger", which seems the correct spelling of her last name according to the mighty Google:

reiniger.zip

You can compare the avocado JSON versus some of the others by commenting in/out the various filenames in the main ViewController's array. You'll see the memory skyrocket while scrolling, whereas the others all seem fine.

BTW, thanks for making this tool!

@RamblinWreck77
Copy link

It seems like there's some kind of bug in CompositionLayer.displayWithFrame

It seems like looped animations will keep updating even when .stop() is called and they're not on-screen anymore.

Using instruments, all the CPU time is in:

AnimatorNode.updateTree

  • AnimatorNode.updateContents

I'm only using one animation and it will chew up ~20% of your CPU until you exit the page. Interestingly setting the AnimationView and/or the animation to nil doesn't stop the cycle, the parent has to be deallocated.

@RamblinWreck77
Copy link

Hmmm, on further inspection what I posted above seems to be my fault. There were a few cases where I was not calling .stop() on animations.

@buba447
Copy link
Collaborator

buba447 commented Nov 25, 2019

This issue is being tracked here
#895

Closing to reduce confusion.

@buba447 buba447 closed this as completed Nov 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants