Skip to content
This repository has been archived by the owner on Jul 28, 2020. It is now read-only.

ArFragment leaking after parent activity finished #1087

Open
0xGuybrush opened this issue May 15, 2020 · 0 comments
Open

ArFragment leaking after parent activity finished #1087

0xGuybrush opened this issue May 15, 2020 · 0 comments

Comments

@0xGuybrush
Copy link

Issue

I was trying to track down a memory leak with ArFragment in my app so I created a minimal, complete, verifiable example here (Git repo).

It looks like with no other code installed, ArFragment is still leaking when its parent activity is closed.

Symptoms

Leak Canary is just showing:

GC Root: global variable in native code

leak-canary-screenshot

I've examined the hprof file (zipped, attached here) and it seems like there's still a reference to the Fragment in its Scene's onUpdateListeners and onPeekTouchListeners:

Seems to still be a reference from Scene's listeners?

But I may not be reading that accurately — Do we need to do additional tear-down for the ArFragment before exiting the activity? Referencing the sample code here, it doesn't look like I'm missing anything else & I've literally stripped out all other interaction with the fragment apart from resuming/pausing it.

Context

Dependencies

Using:

implementation 'com.google.ar:core:1.16.0'
implementation 'com.google.ar.sceneform.ux:sceneform-ux:1.15.0'
implementation 'com.google.ar.sceneform:core:1.15.0'

But was also occuring with AR Core 1.15.0

Device

I'm seeing this on Android 10 / Nokia 8.1


Please let me know if you need more info.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant