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

Memory leak #538

Open
underworld9 opened this issue Feb 18, 2019 · 1 comment
Open

Memory leak #538

underworld9 opened this issue Feb 18, 2019 · 1 comment

Comments

@underworld9
Copy link

underworld9 commented Feb 18, 2019

this is a follow up Issue to #413
While the memory leak of Issue 413 is fixed there are still objects which allocation count rises with each session.
Details:

I have found a memory leak when closing a session. (stopping & destroying the ArCore activity)
found using the Android Profiler.
Total memory has increased. There are some objects with names like "bfs", "bao", "arz", etc. that get increased by 1 after a session was opened.
The allocation count starts at 3 so in the first session the allocation count is 3 in the next 4 and so on.
So after opening a session 3 times these objects have an allocation count of 5.
note: the object with name "bys" is always 3 times the number and "bpa" is always double.

First session:
sample_after_first_open

3rd session:
sample_after_opening_3times

11th session:
sample_after_opening_11times

this is tested in HelloScenform sample and other ArCore apps.
the memory leak happens every time the Activity is destroyed.
it never happens if the Activity is saved and stopped.

the increase in memory is much smaller with 1.7 than it was in 1.6 thanks to the fix in #413 i assume.

@artemtkachenko
Copy link

@underworld9

I am experiencing the same issue.
The hellosceneform profile results. I launched and finished several HelloSceneformActivities one by one. And all of the objects: Camera Texture Scene remains in memory after forcing GC:
https://monosnap.com/file/ewEPKAHXgPRDQRo6JhGRwCuXhcZutl
These objects holds an an ArSceneView that is why HelloSceneformActivitiy leaked.

Moreover I found that with using asyncPause() feature my Pixel3 reports an error:

E/ACameraDevice: onDeviceIdle sending state cb
E/ActivityThread: Activity %app_package_my_activity% has leaked ServiceConnection apy@e18bb27 that was originally bound here
android.app.ServiceConnectionLeaked: Activity %app_package_my_activity% has leaked ServiceConnection apy@e18bb27 that was originally bound here
at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:1610)
at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:1502)
at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:1659)
at android.app.ContextImpl.bindService(ContextImpl.java:1612)
at android.content.ContextWrapper.bindService(ContextWrapper.java:698)
at com.google.ar.core.services.AnalyticsClient.bindService(PG:30)
at com.google.ar.core.Session.nativeCreateSessionWithFeatures(Native Method)
at com.google.ar.core.Session.<init>(Session.java:23)

It seems that all the samples and scene-form itself was not designed for releasing resources.

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

2 participants