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

fix(android-animations): reuse animatorSet to prevent high memory usage #6930

Merged
merged 1 commit into from
Feb 21, 2019

Conversation

ADjenkov
Copy link
Contributor

Do not recreate native animators when looping animation inside keyframe animation.

Android API > 23: Reusing animatorSet instead of recreating it on every animation iteration. This results in even less memory usage. Recreating it on every loop will lead to higher memory peaks (that will be collected a bit later by the GC)

Side note: pulse CSS animation consist multiple keyframes that animate the scale of an object to different values in a different times. New Animation is created for every keyframe in the keyframes rule. These animations (keyframes) will play sequentially and will repeat all together for specified iterations (or infinite). Every Animation (keyframe) has a AnimatorSet that holds multiple Animators depending on the number of properties it should animate. We do not want to recreate these Animators on every Animation (keyframe) replay.

Fix #5731

@ADjenkov ADjenkov self-assigned this Feb 19, 2019
@ghost ghost added the in progress label Feb 19, 2019
@SvetoslavTsenov
Copy link
Contributor

test package_version#latest

@ADjenkov
Copy link
Contributor Author

test package_version#latest

@ADjenkov ADjenkov merged commit 7236d32 into release Feb 21, 2019
@ADjenkov ADjenkov deleted the djenkov/css-animations-leak branch February 21, 2019 08:49
@ghost ghost removed the in progress label Feb 21, 2019
@lock
Copy link

lock bot commented Feb 21, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Feb 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants