{ "id": "79888", "key": "AC-3150", "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": "8", "description": "", "name": "Needs more info" }, "resolutiondate": "2011-12-29T04:30:03.000+0000", "created": "2011-08-31T13:07:24.000+0000", "labels": [], "versions": [], "issuelinks": [ { "id": "14395", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "62245", "key": "TIMOB-1613", "fields": { "summary": "iOS: ImageView not releasing memory when image reassigned", "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": "Low", "id": "4" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "updated": "2016-03-08T07:48:13.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": "h2. Problem\r\n\r\nMemory is not being released when navigating between Windows that contain TableViews, made up of rows with a custom backgroundImage. The problem first became evident when we did \"on device\" testing with an iPod Touch 4G, and did not show up in the simulator.\r\n\r\nh2. Test case\r\n\r\nUsing the code below, navigate numerous times between 'First Window' and 'Second Window', and the app will crash. We originally detected the problem by using Instruments, however I have included an \"Available memory\" label, which also shows the memory leak in action.\r\n\r\nBy simply commenting out the line {{backgroundImage:'tablerow.png'}}, memory is again released as expected.\r\n\r\n{code:lang=javascript|title=app.js}\r\n//Create a window with a button, and a label to show available memory\r\nvar memoryLabel = Ti.UI.createLabel({\r\n\theight:132,\r\n\ttext:'',\r\n\twidth:276\r\n})\r\n\r\nvar openButton = Ti.UI.createButton({\r\n\theight:44,\r\n\ttitle:'Open Second Window',\r\n\twidth:276\r\n});\r\nopenButton.addEventListener('click', openSecondWindow); //When the button is clicked open a new window\r\n\r\nvar firstWindow = Ti.UI.createWindow({\r\n\tbackgroundColor:'#fff',\r\n\tlayout:'vertical',\r\n\ttitle:'First Window'\r\n});\r\nfirstWindow.add(memoryLabel);\r\nfirstWindow.add(openButton);\r\n\r\n//Add the window to a navigation group\r\nvar navGroup = Ti.UI.iPhone.createNavigationGroup({\r\n\twindow:firstWindow\r\n});\r\n\r\n//Add the navigation group to a main application window, and open it\r\nvar appWindow = Ti.UI.createWindow();\r\nappWindow.add(navGroup);\r\nappWindow.open();\r\n\r\n//Display the initial amount of available memory\r\nupdateMemoryLabel();\r\n\r\n\r\n//Open a new window that contains a tableView with 60 rows\r\nfunction openSecondWindow()\r\n{\r\n\tvar tableData = [];\r\n\t\r\n\t//Create 60 tableView rows with background images \r\n\tfor (var i = 0; i < 60; i++)\r\n\t{\r\n\t\tvar tableViewRow = Ti.UI.createTableViewRow({\r\n\t\t\tbackgroundImage:'tablerow.png',\r\n\t\t\theight:100\r\n\t\t});\r\n\t\t\r\n\t\ttableData.push(tableViewRow);\r\n\t}\r\n\r\n\t//Create a tableView and add the rows to it\r\n\tvar tableView = Ti.UI.createTableView({\r\n\t\tseparatorStyle:Ti.UI.iPhone.TableViewSeparatorStyle.NONE\r\n\t});\r\n\ttableView.setData(tableData);\r\n\r\n\t//Create a window, and add the tableView\r\n\tvar secondWindow = Ti.UI.createWindow({\r\n\t\tbackgroundColor:'#fff',\r\n\t\ttitle:'Second Window'\r\n\t});\r\n\tsecondWindow.addEventListener('close', updateMemoryLabel); //When the window is closed, update the available memory display\r\n\tsecondWindow.add(tableView);\t\r\n\r\n\t//Open the new window\r\n\tnavGroup.open(secondWindow);\r\n}\r\n\r\n//Update the label that shows available memory in First Window \r\nfunction updateMemoryLabel()\r\n{\r\n\tmemoryLabel.text = \"Available Memory: \" + Ti.Platform.availableMemory;\r\n}\r\n{code}\r\n", "attachment": [ { "id": "22741", "filename": "Images.zip", "author": { "name": "ukazi", "key": "ukazi", "displayName": "Lothar James Foss", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-08-31T13:07:24.000+0000", "size": 73216, "mimeType": "application/zip" } ], "flagged": false, "summary": "iOS: UI - tableViewRow backgroundImage not released from memory", "creator": { "name": "ukazi", "key": "ukazi", "displayName": "Lothar James Foss", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "ukazi", "key": "ukazi", "displayName": "Lothar James Foss", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "* Titanium SDK 1.7.2\r\n* iOS 4.3.5\r\n* iPod Touch 4G\r\n* OSX 10.7.1\r\n* Titanium Studio 1.0.4.201108101535", "comment": { "comments": [ { "id": "177539", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "Lothar\r\n\r\nThank you for raising such a complete ticket.\r\n\r\nI have been told that this issue been fixed in the latest release, although I cannot find the specific ticket. Would you mind testing your code with 1.8.0.1. If it still persists, then I will escalate this to our engineering team.\r\n\r\nI will mark this resolved for now. Please reopen it once it is complete, and I will move it to the main project.\r\n\r\nThanks", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2011-12-29T04:11:55.000+0000", "updated": "2011-12-29T04:11:55.000+0000" }, { "id": "183574", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "Closing due to inactivity. If this issue still exists, please raise a new ticket, including all the information in the [JIRA Ticket Checklist|https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report#HowtoSubmitaBugReport-JIRATicketChecklist] to ensure that we can escalate it quickly. Read [How to Submit a Bug Report|https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report] if you have not read it before, and always start a ticket using the [JIRA Ticket Template|https://wiki.appcelerator.org/display/guides/JIRA+Ticket+Template].\r\n\r\nThanks in advance", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2012-02-17T02:23:15.000+0000", "updated": "2012-02-17T02:23:15.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }