{ "id": "84581", "key": "TIMOB-7027", "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": "12593", "name": "Release 2.0.0", "archived": false, "released": true, "releaseDate": "2012-03-30" }, { "id": "13170", "name": "Sprint 2012-06", "archived": true, "released": true, "releaseDate": "2012-03-25" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-03-13T10:33:09.000+0000", "created": "2012-01-07T21:26:22.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "module_memory", "qe-testadded" ], "versions": [], "issuelinks": [], "assignee": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2012-07-05T15:55:40.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": "When a view is removed from the window the proxy is being released as it should, but there is still memory that is not released. \r\nSee screen shot of instruments.\r\n\r\nh4. Steps to repro:\r\nStep 1: run the code below\r\nStep 2: have instruments monitoring the allocations of the app\r\nStep 3: click the window (views will be added to the window)\r\nStep 4: click the window again (those views will be removed from the window)\r\nStep 5: with the iOS Simulator selected click Hardware>Simulate Memory Warning\r\nStep 6: notice that the view proxies are released but there is still some memory left over that was not there before creating the views\r\n\r\nStep 7: comment out everything in the click event\r\nStep 8: uncomment Ti.UI.createView();\r\nStep 9: run the app and click the window\r\nStep 10 notice that the memory used jumps up and is not released\r\n\r\n{code:title=\"app.js\"}\r\nvar win = Ti.UI.createWindow({backgroundColor:'white'});\r\nvar testView = null;\r\n\r\nwin.open();\r\n\r\nwin.addEventListener('click', function(e){\r\n\tif(testView){\r\n\t\twin.remove(testView);\r\n\t\ttestView = null;\r\n\t}else{\r\n\t\ttestView = Test.init();\r\n\t\twin.add(testView);\r\n\t}\r\n\t\r\n\t// Ti.UI.createView();\r\n});\r\n\r\nvar Test = (function(){\r\n\tfunction init(){\r\n\t\tvar view = Ti.UI.createView({\r\n\t\t\theight: 200,\r\n\t\t\twidth: 200,\r\n\t\t\tbottom: 20,\r\n\t\t\tbackgroundColor:'blue'\r\n\t\t});\r\n\t\t\r\n\t\tfor(var i = 0; i < 100; i++){\r\n\t\t\tview.add( Ti.UI.createView({backgroundColor: 'red'}) );\r\n\t\t}\r\n\t\t\r\n\t\treturn view;\r\n\t};\r\n\t\t\r\n\treturn {\r\n\t\tinit: init\r\n\t}\r\n})();\r\n{code}", "attachment": [ { "id": "24966", "filename": "Screenshot.jpg", "author": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-01-07T21:29:00.000+0000", "size": 118089, "mimeType": "image/jpeg" } ], "flagged": false, "summary": "iOS: View - not all memory is released when a view is removed", "creator": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "TiSDK 1.8.0.1\r\niOS simulator 5.0", "comment": { "comments": [ { "id": "186647", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing bug. Verified fix on:\r\n\r\nSDK build: 2.0.0.v20120315091738\r\nTitanium Studio, build: 2.0.0.201203142055\r\nxcode: 4.2\r\nDevice: iphone 4s (5.0.1)", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-03-15T12:02:50.000+0000", "updated": "2012-03-15T12:02:50.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }