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

Continuous insertion of multiple animation scenes is a live gift animation muti Out of memory on a 6484-byte #385

Closed
lozn00 opened this issue Jul 14, 2017 · 1 comment

Comments

@lozn00
Copy link

lozn00 commented Jul 14, 2017

Continuous insertion of multiple animation scenes is a live gift animation, and the feeling should be more common too

E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #3
Process: com.buyao.tv, PID: 2937
java.lang.RuntimeException: An error occured while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:300)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
Caused by: java.lang.OutOfMemoryError
at android.support.v4.view.animation.PathInterpolatorApi14.(PathInterpolatorApi14.java:42)
at android.support.v4.view.animation.PathInterpolatorApi14.(PathInterpolatorApi14.java:61)
at android.support.v4.view.animation.PathInterpolatorCompat.create(PathInterpolatorCompat.java:84)
at com.airbnb.lottie.Keyframe$Factory.newInstance(Keyframe.java:147)
at com.airbnb.lottie.Keyframe$Factory.parseKeyframes(Keyframe.java:167)
at com.airbnb.lottie.AnimatableValueParser.parseKeyframes(AnimatableValueParser.java:40)
at com.airbnb.lottie.AnimatableValueParser.parseJson(AnimatableValueParser.java:31)
at com.airbnb.lottie.AnimatableShapeValue$Factory.newInstance(AnimatableShapeValue.java:37)
at com.airbnb.lottie.ShapePath$Factory.newInstance(ShapePath.java:41)
at com.airbnb.lottie.ShapeGroup.shapeItemWithJson(ShapeGroup.java:31)
at com.airbnb.lottie.ShapeGroup$Factory.newInstance(ShapeGroup.java:68)
at com.airbnb.lottie.ShapeGroup$Factory.access$000(ShapeGroup.java:58)
at com.airbnb.lottie.ShapeGroup.shapeItemWithJson(ShapeGroup.java:19)
at com.airbnb.lottie.Layer$Factory.newInstance(Layer.java:275)
at com.airbnb.lottie.LottieComposition$Factory.parsePrecomps(LottieComposition.java:312)
at com.airbnb.lottie.LottieComposition$Factory.fromJsonSync(LottieComposition.java:264)
at com.airbnb.lottie.JsonCompositionLoader.doInBackground(JsonCompositionLoader.java:17)
at com.airbnb.lottie.JsonCompositionLoader.doInBackground(JsonCompositionLoader.java:7)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) 
at java.lang.Thread.run(Thread.java:841) 
07-14 11:29:13.989 2937-3135xxxx E/dalvikvm-heap: Out of memory on a 6484-byte allocation.

gpeal pushed a commit that referenced this issue Jul 20, 2017
PathInterpolator builds an array of quantized interpolator values
upon initialization. This requires many float arrays of ~25
elements to be created. Reusing them with a weak ref static cache
will have significant memory savings in animations that use the
same interpolator many times.

#385
@gpeal
Copy link
Collaborator

gpeal commented Jul 31, 2017

@qssq Can you try on 2.1.2?

@lozn00 lozn00 closed this as completed Aug 9, 2017
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

2 participants