{ "id": "80243", "key": "TIMOB-5279", "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": "12077", "description": "", "name": "Sprint 2011-37", "archived": true, "released": true, "releaseDate": "2011-09-19" }, { "id": "11331", "description": "", "name": "Release 1.8.0", "archived": true, "released": true, "releaseDate": "2011-10-31" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-10-06T23:41:48.000+0000", "created": "2011-09-12T16:18:43.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "branch-5062", "module_tableview", "qe-testadded" ], "versions": [ { "id": "11331", "description": "", "name": "Release 1.8.0", "archived": true, "released": true, "releaseDate": "2011-10-31" } ], "issuelinks": [ { "id": "14782", "type": { "id": "10001", "name": "Cloners", "inward": "is cloned into", "outward": "is cloned from" }, "inwardIssue": { "id": "85466", "key": "TIMOB-7399", "fields": { "summary": "Android: TableView: Scrolling through a Table View with image causes application to run out of memory and hang", "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": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2014-06-19T12:46:35.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": "h1. Problem\r\nWhen you repeatedly scroll up and down in a table view, memory is progressively leaked and is not reclaimed until a memory warning occurs. Do this for long enough, and the app will crash.\r\n\r\nh2. When This Happens\r\nBased on experimentation, I see an inverse correlation between number of rows in the table and how quickly you need to scroll up and down before the table view will start leaking memory. For example, if you only have 50 rows, you have to scroll very quickly to get the problem to start. But if you increase that to 200 rows, it is much easier to see the leak. Further, with 200 rows, if you slowly scroll through, you won't see the problem.\r\n\r\nh2. Sample Code\r\nConsider the following code, and download the attached iproducts.png to your resources directory:\r\n{code:title=app.js}\r\nvar win = Ti.UI.createWindow({ backgroundColor: '#fff' });\r\n\r\nvar rows = [];\r\nfor (var i = 0; i < 200; i++) {\r\n var row = Ti.UI.createTableViewRow();\r\n row.add(Ti.UI.createLabel({ text: 'Row ' + i, left: 70 }));\r\n row.add(Ti.UI.createImageView({ image: 'iproducts.png', left: 10 }));\r\n rows.push(row);\r\n row = null;\r\n}\r\nwin.add(Ti.UI.createTableView({\r\n data: rows,\r\n bottom: 50\r\n}));\r\n\r\nvar freeMemory = Ti.UI.createLabel({\r\n height: 50, bottom: 0\r\n});\r\nsetInterval(function() {\r\n freeMemory.text = 'Free Memory: ' + Ti.Platform.availableMemory;\r\n}, 1000);\r\nwin.add(freeMemory);\r\n\r\nwin.open({\r\n modal: true,\r\n modalStyle: Ti.UI.iPhone.MODAL_PRESENTATION_FORMSHEET\r\n});\r\n{code}\r\n\r\nh2. Steps To Reproduce\r\n\r\n1. Drop the above in an app.js\r\n2. Download the attached iproducts.png to your Resources directory\r\n3. Run the app on an iPad 1; I have reproduced this in the simulator, but it is easier to see and reproduce on an actual device\r\n4. Slowly scroll through the whole table, making sure all of the rows are loaded.\r\n5. Look at the \"Free Memory\" label. You probably saw it decrease as the rows were loaded, and then stabilize. Slow scrolling through the table might cause this number to change, but it should stay pretty stable.\r\n6. Now rapidly scroll up and down in the table view. You should be going at a rate of around 2-3 flicks per second to go from top to bottom, and then 2-3 flicks to get back to the top in another second.\r\n7. Keep doing step 6, and watch \"Free Memory\". It might stay stable for a couple of seconds, but then you should see it go down by a megabyte or more per second. The OS will send a memory warning, and you'll jump back up to having lots of free memory. But it will continue to drain memory, and continue to hit memory warnings, until the OS forces the app to terminate.", "attachment": [ { "id": "22906", "filename": "iproducts.png", "author": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "created": "2011-09-12T16:18:43.000+0000", "size": 2709, "mimeType": "image/png" } ], "flagged": false, "summary": "iOS: Repeatedly Scrolling a Table View Leaks Memory", "creator": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "environment": "Ti SDK built from branch-5062, timestamped 09/08/11 20:52\r\niPad 1 running iOS 4.3.3", "comment": { "comments": [ { "id": "165789", "author": { "name": "rseagraves", "key": "rseagraves", "displayName": "Reggie Seagraves", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Probably a duplicate of this.", "updateAuthor": { "name": "rseagraves", "key": "rseagraves", "displayName": "Reggie Seagraves", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-09-13T08:10:09.000+0000", "updated": "2011-09-13T08:10:09.000+0000" }, { "id": "165984", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "When resolving this bug, please also resolve TIMOB-5247 as DUPLICATE. Confirmed that the fix for this bug works for that one.", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-09-14T08:28:46.000+0000", "updated": "2011-09-14T08:28:46.000+0000" }, { "id": "168002", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Issue was reopened and then marked resolved again, due to misidentification.", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-10-05T05:11:15.000+0000", "updated": "2011-10-05T05:11:15.000+0000" }, { "id": "168173", "author": { "name": "avaghti", "key": "avaghti", "displayName": "Alan Vaghti", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The test in the description of this bug passed as expected with both the iPad simulator 4.3 and the iPad 2 4.3.5 .\n\nHowever the associated bug, TIMOB-5247 continues to fail. There is choppy performance followed by a crash. That test was conducted on an iPod 4.3.3 with SDK 1.8.0.v20111006001414.\n\nReopening issue.", "updateAuthor": { "name": "avaghti", "key": "avaghti", "displayName": "Alan Vaghti", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-10-06T14:58:58.000+0000", "updated": "2011-10-06T14:58:58.000+0000" }, { "id": "168200", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "By QE's own admission, test passes. Related bug should remain open, and the tag marking this bug as a \"duplicate\" has been removed because they are clearly separate issues.", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-10-06T23:41:48.000+0000", "updated": "2011-10-06T23:44:29.000+0000" }, { "id": "175605", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing bug. Verified fix on:\r\n\r\nOS: Mac OS X Lion\r\nTitanium Studio, build: 1.0.7.201112080131\r\nSDK build: 1.8.0.1.v20111209102124\r\nDevice: iphone 4S (5.0.1)", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2011-12-09T15:04:24.000+0000", "updated": "2011-12-09T15:04:24.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }