Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11606] Android: MapView setLocation memory leak

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionNot Our Bug
Resolution Date2012-11-01T18:14:28.000+0000
Affected Version/sRelease 3.0.0
Fix Version/s2012 Sprint 22 API, 2012 Sprint 22
ComponentsAndroid
Labelsapi
ReporterHieu Pham
AssigneeHieu Pham
Created2012-10-30T00:18:39.000+0000
Updated2014-06-19T12:43:15.000+0000

Description

Memory leaks when setLocation is called.
var win = Ti.UI.createWindow({
    backgroundColor : '#00f'
});
 

var map = Titanium.Map.createView({
    mapType : Titanium.Map.STANDARD_TYPE,
    region : {
        latitude : 42.3366,
        longitude : -71.1689,
        latitudeDelta : 0.01,
        longitudeDelta : 0.01
    }
});
 
function UpdateMapRoute(lat, lon)
{
 
    map.setLocation({
        latitude : lat,
        longitude : lon,
        animate : true,
        latitudeDelta : 0.001,
        longitudeDelta : 0.004
    });
 
}
 
var lat = 42.3359;
var lon = -71.1735;
 
setInterval(function(){
    UpdateMapRoute(lat,lon);
    lat = lat + .002;
    lon = lon + .002;
},500);
 
 
 
win.add(map);
win.open();
Run code, wait about ~40s, app wil crash. You can look at DDMS to see that memory is leaking heavily

Comments

  1. Hieu Pham 2012-10-31

    This is a native Android bug that has yet to be resolved: http://code.google.com/p/android/issues/detail?id=2181. Closing as Won't Fix.

JSON Source