{ "id": "85693", "key": "TIMOB-7467", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "12095", "description": "", "name": "Sprint 2012-03", "archived": true, "released": true, "releaseDate": "2012-02-12" }, { "id": "12593", "name": "Release 2.0.0", "archived": false, "released": true, "releaseDate": "2012-03-30" }, { "id": "13070", "description": "Release 1.8 Service Pack 2", "name": "Release 1.8.2", "archived": true, "released": true, "releaseDate": "2012-02-29" } ], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2015-01-22T20:06:17.000+0000", "created": "2012-01-30T10:14:16.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "module_map", "qe-testadded" ], "versions": [ { "id": "12580", "description": "Dual Runtime 1.8.0", "name": "Release 1.8.0.1", "archived": true, "released": true, "releaseDate": "2011-12-22" } ], "issuelinks": [ { "id": "15800", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "87855", "key": "TIMOB-7977", "fields": { "summary": "iOS: Map setAnnotation image doesn't work properly +1.8.2", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2015-01-22T20:06:17.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "h4. PROBLEM DESCRIPTION\r\nUser added and removed annotations from the map, it was releasing the TiMapAnnotationProxy but not the TiMapPinAnnotationView. It kept them \"Living\" and continued to add to their live bytes instead of moving the old ones into \"Transitory\".\r\n\r\nh4. ACTUAL BEHAVIOR \r\nTiMapPinAnnotationView is not being released.\r\n\r\nh4. EXPECTED BEHAVIOR\r\nTiMapPinAnnotationView should be released when not needed.\r\n\r\nh4. TEST CASE\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n title:'Map'\r\n}),\r\nmap = Ti.Map.createView({\r\n region:{\r\n latitude:36,\r\n latitudeDelta:5,\r\n longitude:-93,\r\n longitudeDelta:5\r\n },\r\n toggled:false,\r\n userLocation:false\r\n}),\r\ntoggleAnnos = function(e){\r\n var lat = 31,\r\n lng = (e.source.toggled ? -98 : -89),\r\n annos = [];\r\n for(i=0;i<10;i++){\r\n annos.push({latitude:lat,longitude:lng}); \r\n lat++;\r\n if(e.source.toggled){\r\n lng++;\r\n }else{\r\n lng--;\r\n }\r\n }\r\n e.source.removeAllAnnotations();\r\n e.source.addAnnotations(annos);\r\n e.source.toggled = !e.source.toggled;\r\n};\r\nwin.add(map);\r\nwin.open();\r\nmap.addEventListener('regionChanged',toggleAnnos);\r\n{code}\r\n\r\nh4. COMMUNITY DISCUSSION\r\nhttp://developer.appcelerator.com/question/131291/map-annotation-memory-leak\r\n", "attachment": [ { "id": "53766", "filename": "AnnotationsReleased.png", "author": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-01-22T20:00:46.000+0000", "size": 98355, "mimeType": "image/png" }, { "id": "46954", "filename": "Screen Shot 2014-03-28 at 2.44.44 PM.png", "author": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-03-28T21:48:20.000+0000", "size": 149316, "mimeType": "image/png" } ], "flagged": false, "summary": "iOS: Map Annotation Memory Leak", "creator": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "subtasks": [], "reporter": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "environment": "Titanium SDK version: 1.8.0.1\r\nPlatform & version: iOS 5.0 \r\nDevice Details: iOS simulator (ipad) \r\nHost Operating System: OSX Lion\r\nTitanium Studio version: 1.0.7", "closedSprints": [ { "id": 291, "state": "closed", "name": "2015 Sprint 01 SDK", "startDate": "2015-01-03T01:00:00.000Z", "endDate": "2015-01-17T01:00:00.000Z", "completeDate": "2015-01-19T17:24:40.828Z", "originBoardId": 114 }, { "id": 309, "state": "closed", "name": "2015 Sprint 02 SDK", "startDate": "2015-01-17T01:00:16.697Z", "endDate": "2015-01-31T01:00:00.000Z", "completeDate": "2015-02-02T14:36:09.696Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "182290", "author": { "name": "mpettiford", "key": "mpettiford", "displayName": "Michael Pettiford", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing issue\r\n\r\nTested with Ti Studio build 1.0.8.201201262211\r\nTi Mob SDK 1.9.0.v20120207124634\r\nOSX Lion 10.7.2\r\n\r\nExpected behavior is shown of no memory leaks when changing map annotations", "updateAuthor": { "name": "mpettiford", "key": "mpettiford", "displayName": "Michael Pettiford", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-02-07T15:28:40.000+0000", "updated": "2012-02-07T15:28:40.000+0000" }, { "id": "299217", "author": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Reopened, please refer to the screenshot\nMac osx 10.9.2 Mavericks \nAppcelerator Studio, build: 3.2.3.201403271839 \nTitanium SDK, build:3.2.3.v20140327115429 \nNode.JS Version: v0.10.13 \nNPM Version: 1.3.2 \n/usr/local/lib \n├── acs@1.0.14 \n├── alloy@1.3.1 \n├── node-appc@0.2.0 \n├── npm@1.3.2 \n├── titanium@3.2.3-alpha2 \n└── titanium-code-processor@1.1.1-alpha \nDevices: \niPad air iOS 7.1 \niPhone 5S iOS 7.1", "updateAuthor": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-03-28T21:46:52.000+0000", "updated": "2014-03-28T21:46:52.000+0000" }, { "id": "335029", "author": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The issue still exists. The TiMapPinAnnotationView object is not released.\r\nTested on:\r\nSDK: 3.5.0.v20141203160911\r\nStudio: 3.4.1.201410281743\r\nCLI: 3.4.1\r\nAlloy: 1.5.1\r\nTi.Map: 2.2.0\r\nXcode: 6.1\r\nDevice: iPad mini 3 (v8.1)", "updateAuthor": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-12-05T09:57:36.000+0000", "updated": "2014-12-05T09:57:36.000+0000" }, { "id": "340291", "author": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "body": "TiMapPinAnnotationViews are getting released as they should.\r\n\r\nIn the attached screen shot !AnnotationsReleased.png!\r\nSee the number of persistent annotations is 10 and the number of transient is 510. This means that 520 annotations were created and 510 have been released as expected. The other 10 annotations are still alive because they are currently on the map.\r\n\r\nh5. To test\r\n1. Include the latest iOS Map module (2.2.0 at the time of writing)\r\n2. Use the example code below\r\n3. Build the app\r\n4. In the `build/iphone/` folder, open the Xcode project with Xcode.\r\n5. In Xcode click *Product*>*Profile*\r\n6. When given the option of what type of profiling to do, select \"Memory Leaks\"\r\n7. In Instruments click the \"Record\" button\r\n8. The app will launch on the *simulator*\r\n9. In the filter type \"TiMap\"\r\n10. In the app move the map a little bit\r\n11. Notice the \"# Persistent\" and \"# Transient\"\r\n12. After moving the map a few times, you may see that the number of persistent Annotations is more than 10\r\n13. In the simulator menu, click *Hardware*>*Simulate Memory Warning*\r\n14. Notice the number of Annotations drop down to 10 (These are the 10 currently displayed on the map)\r\n15. You will also see the number of Persistent Annotations drop after you move the map a few more times and create a little memory pressure.\r\n\r\n{code}\r\nvar Map = require('ti.map');\r\n\r\nvar win = Ti.UI.createWindow({\r\n title:'Map'\r\n}),\r\n// map = Ti.Map.createView({\r\nmap = Map.createView({\r\n region:{\r\n latitude:36,\r\n latitudeDelta:5,\r\n longitude:-93,\r\n longitudeDelta:5\r\n },\r\n toggled:false,\r\n userLocation:false\r\n}),\r\ntoggleAnnos = function(e){\r\n var lat = 31,\r\n lng = (e.source.toggled ? -98 : -89),\r\n annos = [];\r\n for(i=0;i<10;i++){\r\n annos.push({latitude:lat,longitude:lng}); \r\n lat++;\r\n if(e.source.toggled){\r\n lng++;\r\n }else{\r\n lng--;\r\n }\r\n }\r\n e.source.removeAllAnnotations();\r\n e.source.addAnnotations(annos);\r\n e.source.toggled = !e.source.toggled;\r\n};\r\nwin.add(map);\r\nwin.open();\r\nmap.addEventListener('regionChanged',toggleAnnos);\r\n{code}", "updateAuthor": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-01-22T20:05:19.000+0000", "updated": "2015-01-22T20:05:19.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }