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.
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
https://github.com/google-ar/arcore-android-sdk/assets/12823373/39b113c6-6ee5-43aa-a412-8fdcf4f3fa3b