{ "id": "80703", "key": "AC-3143", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-10-04T15:01:28.000+0000", "created": "2011-09-28T13:13:32.000+0000", "labels": [ "ios", "tableview", "ui" ], "versions": [], "issuelinks": [], "assignee": { "name": "kwhinnery", "key": "kwhinnery", "displayName": "Kevin Whinnery", "active": true, "timeZone": "America/Chicago" }, "updated": "2016-03-08T07:48:12.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": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "While profiling our app I noticed that scrolling through the stream continues to generate new views rather than reusing existing ones. These rows do in fact have classNames set, and when the table is cleared, all the views are indeed garbage collected, so I do not believe it is an issue of external references being kept. Also of interest, the # of transitory instances also continues to rise, suggesting that the rows are being continuously garbage collected and recreated (potentially as a result of continuous setData calls).\r\n\r\nVideo of the issue: http://cl.ly/1M3L2T2y2k3k1q1y3g2Y\r\nFactory method used to generate these rows: https://gist.github.com/7bd7d37b056562eb9962\r\n\r\nNot that to page in new rows, they are added to the main tableViewSection, and then setData is called on the table with the entire array of sections again", "attachment": [], "flagged": false, "summary": "Rows are not being reused even though className is set", "creator": { "name": "getglue", "key": "getglue", "displayName": "GetGlue", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "getglue", "key": "getglue", "displayName": "GetGlue", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Ti 1.7.2", "comment": { "comments": [ { "id": "167946", "author": { "name": "adecena", "key": "adecena", "displayName": "Anthony Decena", "active": true, "timeZone": "America/Los_Angeles" }, "body": "\r\n{code}\r\nvar win = Ti.UI.createWindow();\r\n\r\nfunction createRow(c) {\r\n\t\tvar row = Ti.UI.createTableViewRow();\r\n\trow.selectedBackgroundColor = '#fff';\r\n\trow.height = 100;\r\n\trow.className = 'datarow';\r\n\trow.clickName = 'row';\r\n\r\n\tvar photo = Ti.UI.createView({\r\n\t\tbackgroundImage:'user.png',\r\n\t\ttop:5,\r\n\t\tleft:10,\r\n\t\twidth:50,\r\n\t\theight:50,\r\n\t\tclickName:'photo'\r\n\t});\r\n\trow.add(photo);\r\n\r\n\r\n\tvar user = Ti.UI.createLabel({\r\n\t\tcolor:'#576996',\r\n\t\tfont:{fontSize:16,fontWeight:'bold', fontFamily:'Arial'},\r\n\t\tleft:70,\r\n\t\ttop:2,\r\n\t\theight:30,\r\n\t\twidth:200,\r\n\t\tclickName:'user',\r\n\t\ttext:'Fred Smith '+c\r\n\t});\r\n\r\n\trow.filter = user.text;\r\n\trow.add(user);\r\n\r\n\tvar fontSize = 16;\r\n\tif (Titanium.Platform.name == 'android') {\r\n\t\tfontSize = 14;\r\n\t}\r\n\tvar comment = Ti.UI.createLabel({\r\n\t\tcolor:'#222',\r\n\t\tfont:{fontSize:fontSize,fontWeight:'normal', fontFamily:'Arial'},\r\n\t\tleft:70,\r\n\t\ttop:21,\r\n\t\theight:50,\r\n\t\twidth:200,\r\n\t\tclickName:'comment',\r\n\t\ttext:'Got some fresh fruit, conducted some business, took a nap'\r\n\t});\r\n\trow.add(comment);\r\n\r\n\tvar calendar = Ti.UI.createView({\r\n\t\tbackgroundImage:'/KS_nav_ui.png',\r\n\t\tbottom:2,\r\n\t\tleft:70,\r\n\t\twidth:32,\r\n\t\tclickName:'calendar',\r\n\t\theight:32\r\n\t});\r\n\trow.add(calendar);\r\n\r\n\tvar button = Ti.UI.createView({\r\n\t\tbackgroundImage:'KS_nav_views.png',\r\n\t\ttop:35,\r\n\t\tright:5,\r\n\t\twidth:36,\r\n\t\tclickName:'button',\r\n\t\theight:34\r\n\t});\r\n\trow.add(button);\r\n\r\n\tvar date = Ti.UI.createLabel({\r\n\t\tcolor:'#999',\r\n\t\tfont:{fontSize:13,fontWeight:'normal', fontFamily:'Arial'},\r\n\t\tleft:105,\r\n\t\tbottom:5,\r\n\t\theight:20,\r\n\t\twidth:100,\r\n\t\tclickName:'date',\r\n\t\ttext:'posted on 3/11'\r\n\t});\r\n\trow.add(date);\r\n\treturn row;\r\n}\r\n\r\nvar data = [];\r\nvar lastRow = 10;\r\nfor (var c=0;c= nearEnd))\r\n\t\t{\r\n\t\t\tbeginUpdate();\r\n\t\t}\r\n\t}\r\n\tlastDistance = distance;\r\n});\r\n\r\n\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "adecena", "key": "adecena", "displayName": "Anthony Decena", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-10-04T14:37:53.000+0000", "updated": "2011-10-04T14:37:53.000+0000" }, { "id": "167948", "author": { "name": "getglue", "key": "getglue", "displayName": "GetGlue", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Does this also produce the same issue? If it does it goes against my hunch that it was setData causing the issue, since you are paging in new rows with appendRow", "updateAuthor": { "name": "getglue", "key": "getglue", "displayName": "GetGlue", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-10-04T14:44:10.000+0000", "updated": "2011-10-04T14:44:10.000+0000" }, { "id": "167953", "author": { "name": "adecena", "key": "adecena", "displayName": "Anthony Decena", "active": true, "timeZone": "America/Los_Angeles" }, "updateAuthor": { "name": "adecena", "key": "adecena", "displayName": "Anthony Decena", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-10-04T15:01:00.000+0000", "updated": "2011-10-04T15:01:00.000+0000" }, { "id": "169888", "author": { "name": "judeosborn", "key": "judeosborn", "displayName": "Jude Osborn", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Glad to see this is being considered. Table performance is nearly a deal breaker for us as far as using Titanium with our apps.", "updateAuthor": { "name": "judeosborn", "key": "judeosborn", "displayName": "Jude Osborn", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-10-20T12:22:13.000+0000", "updated": "2011-10-20T12:22:13.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }