[TIMOB-8697] iOS: MapView: Memory leaks detected while scrolling around in the map view so that the red pins change using iPad 2.
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Hold |
Resolution Date | 2012-04-25T11:17:04.000+0000 |
Affected Version/s | Release 2.0.1 |
Fix Version/s | Release 2.1.0, Sprint 2012-09 API |
Components | iOS |
Labels | api, qe-ios040912 |
Reporter | Anshu Mittal |
Assignee | Sabil Rahim |
Created | 2012-04-12T03:21:34.000+0000 |
Updated | 2017-03-07T18:28:09.000+0000 |
Description
Memory leaks detected while scrolling around in the map view so that the red pins change using iPad 2.(Test Case- TIMOB-7467)
Steps to reproduce:
1. Install app to iOS device
2. Open Instruments
3. Select Leaks for iOS device
4. Press Choose
5. Under Choose Target, select Map and press Record
6. Scroll around in the map view so that the red pins change
7. Do a search in instruments for "TiMapPinAnnotationView"
Expected result:
After step 6: You shouldn't have any new memory leaks (note there may be a memory leak from when the app first launched but this is a known issue)
After step 7: You should see the variable "TiMapPinAnnotationView"
Actual Result:
After step 7, memory leaks are detected. Please refer to the Instruments_map.trace file attached.
App.js
var win = Ti.UI.createWindow({
backgroundColor: '#fff'
});
map = Ti.Map.createView({
region : {
latitude : 36,
latitudeDelta : 5,
longitude : -93,
longitudeDelta : 5
},
toggled : false,
userLocation : false
}), toggleAnnos = function(e) {
var lat = 31, lng = (e.source.toggled ? -98 : -89), annos = [];
for( i = 0; i < 10; i++) {
annos.push({
latitude : lat,
longitude : lng
});
lat++;
if(e.source.toggled) {
lng++;
} else {
lng--;
}
}
e.source.removeAllAnnotations();
e.source.addAnnotations(annos);
e.source.toggled = !e.source.toggled;
};
win.add(map);
map.addEventListener('regionChanged', toggleAnnos);
win.open();
Attachments
File | Date | Size |
---|---|---|
Instruments_map.trace.zip | 2012-04-12T03:21:34.000+0000 | 3983278 |
@Anshu This issue is labeled as a regression, but there is not information about which version this regresses from.. can you provide that?
Tested with 2.0.0 and 1.8.2 and still see the leak. Removed regression tag.
Found that there is no memory leak on TiMapPinAnnotationView, but did notice there was a memory leak of 48bytes which was being caused by an Malloc on UIScorllView GestureRecognizer on ScrollEvent. After some digging around did figure out this is actually an well documented Apple bug and "Apple also assures that this will not cause any app to crash".(Sure enough its 48bytes each). The relevant Apple forum links are [here](https://devforums.apple.com/message/630695#630695), which matches exactly with the stack trace of the leak as I observed from Instruments. Going to mark this as an HOLD as its an "Apple Bug".
This even occurs on iPhone 4s(5.1)
Closing ticket due to time passed.