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

Crash issue: It is presumed to be a crash due to memory shortage. #40

Open
eunryu93 opened this issue Oct 7, 2024 · 3 comments
Open

Comments

@eunryu93
Copy link

eunryu93 commented Oct 7, 2024

Hello,

I am creating an issue regarding a crash that was identified while using this library.

We have noticed a sudden spike in memory usage while using this library. (We are using it to generate a loading bar, and each time the loading bar is created, we observed a sharp increase in memory usage.)

While preparing to launch the app, our QA team reported crashes during testing. Upon investigation, we found that this issue frequently occurs on low-spec devices. When debugging with Xcode, we received an alert indicating a crash due to memory shortage. On devices with lower memory capacity, we also noticed that the devices get quite hot, and both CPU and memory usage spike. Upon further investigation using Instruments, we confirmed that the player object is not being released after being created, leading to multiple instances being generated.

This crash is also occurring in the live app, and we have attached logs obtained via Firebase Crashlytics. Although we have also included screenshots, it has been confirmed that the crash is happening in DotLottieAnimationView.swift, specifically at line 31 in Coordinator.swift related to mtkView. The error occurs intermittently, 3-4 times a week, but is consistently being reported. It affects various devices, primarily older models. This issue has been consistently occurring since we switched from the Lottie library to the DotLottie library.

We have since updated the app version, reverting to using the Lottie library to handle dotLottie files, and we are monitoring the situation. If the issue no longer occurs, we assume it is indeed related to the DotLottie library.

Here are the steps I have tried:

Created the DotLottie model and attempted to release it from memory by setting it to nil, followed by setting the loading view to nil: it still was not released from memory.
Modified the logic to prevent the creation of a new DotLottie object if one already exists: this had no effect.
Implemented a singleton pattern and added safeguards to avoid multiple object creations: the crash persisted despite this.
Could you please let me know if there is a possible solution to this issue? I would greatly appreciate it if you could look into this matter and provide any suggestions for resolving it.

Attach ScreenShot:
스크린샷 2024-09-27 11 26 19

@samuelOsborne
Copy link
Member

hello @eunryu93 Thank you for your detailed ticket. It is an issue we've identified within the core player, written in rust, we have a PR open for it here: LottieFiles/dotlottie-rs#102

I'll look in to this again and try and get it completed and brought in to this repo.

Thanks

@eunryu93
Copy link
Author

eunryu93 commented Oct 7, 2024

@samuelOsborne Oh, I see. Thank you for your answer. If you don't mind, I'd like to contribute to the issue as well. Would that be okay?

@samuelOsborne
Copy link
Member

of course @eunryu93 :))

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