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

LRUAnimationCache should be smarter? #1774

Closed
marcelofabri opened this issue Oct 17, 2022 · 3 comments · Fixed by #1783
Closed

LRUAnimationCache should be smarter? #1774

marcelofabri opened this issue Oct 17, 2022 · 3 comments · Fixed by #1783

Comments

@marcelofabri
Copy link
Contributor

Which Version of Lottie are you using?

Lottie 3.5.0

Expected Behavior

LRUAnimationCache should:

  1. have a memory limit
  2. evict when getting memory warnings

I'm curious why we're not using a NSCache instead.

Actual Behavior

The limit is based on number of animations, which can widely vary. It also never clears any cached animations under memory pressure.

@calda
Copy link
Member

calda commented Oct 17, 2022

I'm open to providing alternative, smarter cache implementations, and updating the default cache used in our animation helper functions. I don't think we can remove or change the behavior of the existing LRUAnimationCache though, since that would be source breaking for consumers.

@marcelofabri
Copy link
Contributor Author

Yeah, we can keep it around, but having the right default is the most important thing IMO.

@marcelofabri
Copy link
Contributor Author

Also found #1411 which is pretty similar with what I had in mind

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants