When we do frame animation, out of memory

Asked 2 years ago, Updated 2 years ago, 24 views

Hi, how are you?

frame animation about 100 pages using the image animation that wants to have a go. The size of about 750 1334.

Is there any other way to get out of memory?

android

2022-09-21 20:48

1 Answers

An image of that size requires approximately 750 * 1334 * 4 = 4MB of memory (assuming ARGB_8888). Frame animation is a method of loading all images into memory, so 100 sheets require about 400 MB of memory, which seems to cause out of memory because it cannot be allocated.

Since there are many images currently used for animation, I think it would be better to use an implementation other than the frame animation provided by Android.

The above library sequentially uploads and releases images to memory. Please refer to the link above to modify the code.


2022-09-21 20:48

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.