{ "id": "150820", "key": "TIMOB-19861", "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": [], "resolution": null, "resolutiondate": null, "created": "2015-08-28T19:26:52.000+0000", "priority": null, "labels": [], "versions": [], "issuelinks": [], "assignee": null, "updated": "2018-02-28T19:55:45.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [], "description": "Create a default Alloy project with the following:\r\n\r\nindex.js\r\n{code}\r\nAlloy.createCollection(\"samplea\").fetch();\r\nAlloy.createCollection(\"sampleb\").fetch();\r\n$.index.open();\r\n{code}\r\n\r\nindex.xml\r\n{code}\r\n\r\n\t\r\n\r\n{code}\r\n\r\nmodels/samplea.js\r\n{code}\r\nexports.definition = {\r\n\tconfig: {\r\n\t\t\"columns\": {\r\n\t\t\t\"id\":\"INTEGER\"\r\n\t\t},\r\n\t\t\"adapter\": {\r\n\t\t\t\"type\": \"sql\",\r\n\t\t\t\"collection_name\": \"sampleas\",\r\n\t\t\t\"idAttribute\":\"id\"\r\n\t\t}\r\n\t},\r\n\r\n\textendModel : function(Model) {\r\n\t\t_.extend(Model.prototype, {\r\n\t\t});\r\n\r\n\t\treturn Model;\r\n\t},\r\n\r\n\textendCollection : function(Collection) {\r\n\t\t_.extend(Collection.prototype, {\r\n\t\t});\r\n\r\n\t\treturn Collection;\r\n\t}\r\n};\r\n{code}\r\n\r\nmodels/sampleb.js\r\n{code}\r\nexports.definition = {\r\n\tconfig: {\r\n\t\t\"columns\": {\r\n\t\t\t\"id\":\"INTEGER\"\r\n\t\t},\r\n\t\t\"adapter\": {\r\n\t\t\t\"type\": \"sql\",\r\n\t\t\t\"collection_name\": \"samplebs\",\r\n\t\t\t\"idAttribute\":\"id\"\r\n\t\t}\r\n\t},\r\n\r\n\textendModel : function(Model) {\r\n\t\t_.extend(Model.prototype, {\r\n\t\t});\r\n\r\n\t\treturn Model;\r\n\t},\r\n\r\n\textendCollection : function(Collection) {\r\n\t\t_.extend(Collection.prototype, {\r\n\t\t});\r\n\r\n\t\treturn Collection;\r\n\t}\r\n};\r\n{code}\r\n\r\nUsing xCode instrument \"Leaks\" to monitor the app. Soon after launching the app, there appear several leaked objects.", "attachment": [], "flagged": false, "summary": "Alloy Collection - Dealing two or more collections at the same time causes memory leak", "creator": { "name": "shawnlan", "key": "shawnlan", "displayName": "Shawn Lan", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "shawnlan", "key": "shawnlan", "displayName": "Shawn Lan", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "SDK 4.1.0 iOS8", "comment": { "comments": [ { "id": "361638", "author": { "name": "shawnlan", "key": "shawnlan", "displayName": "Shawn Lan", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I've done more testings. It doesn't need to be two different collections. The following produces the same result:\r\n{code}\r\nAlloy.createCollection(\"samplea\").fetch();\r\nAlloy.createCollection(\"samplea\").fetch();\r\n{code}\r\n\r\nHowever, if the second fetch() is run long after the first fetch(), there is no leaked object:\r\n{code}\r\nAlloy.createCollection(\"samplea\").fetch();\r\nsetTimeout(function(){Alloy.createCollection(\"sampleb\").fetch();},3600000);\r\n{code}", "updateAuthor": { "name": "shawnlan", "key": "shawnlan", "displayName": "Shawn Lan", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-08-29T01:10:50.000+0000", "updated": "2015-08-29T01:10:50.000+0000" }, { "id": "368953", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, This is still a bug in the latest releases. I tested with Studio 4.3.3.201510212245. Ti SDK 5.0.2.GA and iOS 9.1. The memory leak occurs. I also tried [~shawnlan] test with two similar collections. The result still the same. Thanks.", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2015-11-04T07:19:14.000+0000", "updated": "2015-11-04T07:19:14.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }