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

Out of Memory (OOM) error occurs during long running. #300

Closed
SamayLi opened this issue Aug 23, 2023 · 2 comments
Closed

Out of Memory (OOM) error occurs during long running. #300

SamayLi opened this issue Aug 23, 2023 · 2 comments

Comments

@SamayLi
Copy link

SamayLi commented Aug 23, 2023

I am using this Rive in Activity but when running for a long time, the following OOM occurs.How should I solve this problem?
Additional information:

  1. The runtime is approximately 10-15 minutes.
  2. According to the requirements of the design team, I need to set a state value every 20ms to drive the change in animation amplitude.
08-23 18:54:59.496 25263 25263 E AndroidRuntime: FATAL EXCEPTION: main
08-23 18:54:59.496 25263 25263 E AndroidRuntime: Process: com.ss.meetx.room, PID: 25263
08-23 18:54:59.496 25263 25263 E AndroidRuntime: java.lang.OutOfMemoryError: Failed to allocate a 55380616 byte allocation with 25165824 free bytes and 41MB until OOM, target footprint 518062048, growth limit 536870912
08-23 18:54:59.496 25263 25263 E AndroidRuntime: 	at java.util.Arrays.copyOf(Arrays.java:3136)
08-23 18:54:59.496 25263 25263 E AndroidRuntime: 	at java.util.Arrays.copyOf(Arrays.java:3106)
08-23 18:54:59.496 25263 25263 E AndroidRuntime: 	at java.util.ArrayList.grow(ArrayList.java:275)
08-23 18:54:59.496 25263 25263 E AndroidRuntime: 	at java.util.ArrayList.ensureExplicitCapacity(ArrayList.java:249)
08-23 18:54:59.496 25263 25263 E AndroidRuntime: 	at java.util.ArrayList.ensureCapacityInternal(ArrayList.java:241)
08-23 18:54:59.496 25263 25263 E AndroidRuntime: 	at java.util.ArrayList.add(ArrayList.java:467)
08-23 18:54:59.496 25263 25263 E AndroidRuntime: 	at app.rive.runtime.kotlin.core.StateMachineInstance.convertInput(StateMachineInstance.kt:95)
08-23 18:54:59.496 25263 25263 E AndroidRuntime: 	at app.rive.runtime.kotlin.core.StateMachineInstance.input(StateMachineInstance.kt:111)
08-23 18:54:59.496 25263 25263 E AndroidRuntime: 	at app.rive.runtime.kotlin.core.StateMachineInstance.input(StateMachineInstance.kt:120)
08-23 18:54:59.496 25263 25263 E AndroidRuntime: 	at app.rive.runtime.kotlin.controllers.RiveFileController.setNumberState(RiveFileController.kt:422)
08-23 18:54:59.496 25263 25263 E AndroidRuntime: 	at app.rive.runtime.kotlin.RiveAnimationView.setNumberState(RiveAnimationView.kt:471)
08-23 18:54:59.496 25263 25263 E AndroidRuntime: 	at com.ss.meetx.speech.view.SpeechLayout.changeVoiceVolume(SpeechLayout.kt:402)
@umberto-sonnino
Copy link
Contributor

Going to close this issue since this is a duplicate of #297

Like I mentioned in the other thread, it might be worth upgrading to the latest version of our library (currently it's 8.2.2) as that might solve your problems. Is there anything that's preventing you from doing that?

Also, we'd really need a repro for the issue to look into it! Could you build a small sample app in a GitHub repository and share it here?

@SamayLi
Copy link
Author

SamayLi commented Aug 23, 2023

We are using version 4.4.0。Currently, due to issues with our project's Gradle and Kotlin versions, we are temporarily unable to use higher versions.

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