Leaking LocationListener in LocationDisplayManager

3203
4
11-28-2014 06:34 AM
LukaszSzczyglowski
New Contributor

Hi guys,

I have found out that once the .start() method has been called on the LocationDisplayManager class, the inner LocationListener is not unregistered from the LocationManager even if the stop() and/or pause() methods have been called.

This triggers really bad leaking flow leading to an issue, that even the Context itself cannot be garbage collected.

Looking forward to your responses.

Regards,

Lukasz

4 Replies
GSauers
Occasional Contributor

I am seeing the same issue in my application. A solution is needed ASAP. I am using ArcGIS SDK 10.2.5.

Thanks.

0 Kudos
DanO_Neill
Occasional Contributor III

I have confirmed and reproduced the issue and we are working on a fix. 

0 Kudos
GSauers
Occasional Contributor

Great, thanks Dan.

0 Kudos
DanO_Neill
Occasional Contributor III

The issue I found is that the LocationDisplayManager was not reallocating resources when .stop() was called.  This amounted to ~2MB of memory overhead.  The bigger issue was that the app would continue to consume memory.  We have a fix that reallocates memory back and ensures the app responds to garbage collection of which it did not before. 

Regarding the Context not being garbage collected, this is because the Context is tied to the MapView whether directly or in relation to it's corresponding layout.

The fix will be in the next minor release ArcGIS Runtime SDK for Android, v10.2.6.