google-ar / arcore-android-sdk

ARCore SDK for Android Studio
https://developers.google.com/ar
Other
4.91k stars 1.2k forks source link

Native heap keeps growing during fragments or activities switch continuously #1604

Open YinXiuYu opened 10 months ago

YinXiuYu commented 10 months ago

STEPS TO REPRODUCE THE ISSUE

We put ARcore-based code, like helloAR in one fragment (F1) or activity and other code in another fragment or activity(F2), we keep switch F1 and F2 ( going to F1, wait a second, then going to F2, wait a second, then going to F1, and so on). There will be a growing of native heap. It can be shown in the graph attached. This graph got with pixel 5. This growing might cause other crash and space waste, so we need help to solve it.

By using the helloar application, create a new empty activity. By repeatedly switching between the two activities, you can reproduce the issue of native memory continues to increase and is not released. The example APK and step-by-step reproduction video are uploaded in the attachment.

Thanks a lot for support.

ADDITIONAL COMMENTS

Tue Aug 08 2023 14_03_00 GMT+0800 (中国标准时间)

Tue Aug 08 2023 14_08_31 GMT+0800 (中国标准时间)

https://github.com/google-ar/arcore-android-sdk/assets/12823373/39b113c6-6ee5-43aa-a412-8fdcf4f3fa3b

Kykara4uk commented 7 months ago

+1, any updates on this issue so far?