{ "id": "86445", "key": "TIMOB-7642", "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": "12096", "description": "", "name": "Sprint 2012-04", "archived": true, "released": true, "releaseDate": "2012-02-26" }, { "id": "12593", "name": "Release 2.0.0", "archived": false, "released": true, "releaseDate": "2012-03-30" }, { "id": "13270", "description": "Release 1.8 Service Pack 3 (CI for 1_8_X)", "name": "Release 1.8.3", "archived": true, "released": false } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-04-19T13:19:58.000+0000", "created": "2012-02-13T19:07:37.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "memory", "module_webview", "qe-testadded", "webview" ], "versions": [ { "id": "12677", "description": "Release 1.8 Service Pack 1", "name": "Release 1.8.1", "archived": true, "released": true, "releaseDate": "2012-01-31" } ], "issuelinks": [], "assignee": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2012-04-19T13:19:58.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": "Memory is not being released when a webview, with a local HTML file, is added to a window and then removed from it. But this does not happen when a remote URL is used. Below is the sample code and the local HTML file has been attached.\r\n\r\n*Sample Code*\r\n{noformat}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor : 'white'\r\n});\r\n\r\nvar webview = null;\r\n\r\nvar btnAdd = Ti.UI.createButton({\r\n title : 'Add',\r\n top : 0,\r\n left : 0,\r\n height : 50,\r\n width : 100\r\n});\r\n\r\nbtnAdd.addEventListener('click', function() {\r\n webview = Ti.UI.createWebView({\r\n url : 'local_webview.html',\r\n // url : 'http://www.google.com',\r\n height : 200,\r\n bottom : 10\r\n });\r\n \r\n win.add(webview);\r\n});\r\n\r\nvar btnRemove = Ti.UI.createButton({\r\n title : 'Remove',\r\n top : 0,\r\n right : 0,\r\n height : 50,\r\n width : 100\r\n});\r\n\r\nbtnRemove.addEventListener('click', function() {\r\n win.remove(webview);\r\n webview = null;\r\n});\r\nwin.add(btnAdd);\r\nwin.add(btnRemove);\r\nwin.open();\r\n{noformat}\r\n\r\n*STEPS TO REPRODUCE*\r\n- Drop the above sample code into app.js and copy the attached 'local_webview.html' to Resources folder.\r\n- Start the application and open Instruments to profile it.\r\n- Click the 'Add' button and then the 'Remove' button.\r\n- Search for 'proxy' in instruments and it can be seen that webview proxies are not released even if memory warnings are simulated.\r\n\r\n*EXPECTED BEHAVIOR*\r\nProxies related to webview should be released.\r\n\r\n*OBSERVED BEHAVIOR*\r\nMemory is not being freed.\r\n\r\n*OTHER OBSERVATIONS*\r\nMemory is being freed when a remote URL (uncomment the line with google.com and comment out the line with local_webview.html) is used.", "attachment": [ { "id": "25757", "filename": "local_webview.html", "author": { "name": "sbhimavarapu", "key": "sbhimavarapu", "displayName": "Sandeep Bhimavarapu", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-02-13T19:07:37.000+0000", "size": 1021, "mimeType": "text/html" } ], "flagged": false, "summary": "iOS: Memory Leak when local html file is used in a WebView", "creator": { "name": "sbhimavarapu", "key": "sbhimavarapu", "displayName": "Sandeep Bhimavarapu", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "sbhimavarapu", "key": "sbhimavarapu", "displayName": "Sandeep Bhimavarapu", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Product: Titanium Mobile\r\nTitanium SDK: 1.8.1, 1.9.0 CI\r\nHost OS: Mac OS X Lion\r\nPlatform OS: iOS\r\nPlatform OS Version: 5.0", "comment": { "comments": [ { "id": "187082", "author": { "name": "mpettiford", "key": "mpettiford", "displayName": "Michael Pettiford", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Reopening issue\r\n\r\nTested with Ti Studio build 2.0.0.201203182248\r\nTi Mob SDK 2.0.0.v20120319003254 hash r60b6da4c\r\nOSX Lion 10.7.3\r\niPhone 4 OS 5.0.1\r\n\r\nI'm still seeing the fail case as noted in the ticket. When I change the url it works as expected.", "updateAuthor": { "name": "mpettiford", "key": "mpettiford", "displayName": "Michael Pettiford", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-19T09:56:53.000+0000", "updated": "2012-03-19T09:56:53.000+0000" }, { "id": "187096", "author": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "body": "To force JS GC on a device: press Home button, launch another app (Stocks/Clock), return back to the app.", "updateAuthor": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-19T10:22:52.000+0000", "updated": "2012-03-19T10:22:52.000+0000" }, { "id": "187098", "author": { "name": "mpettiford", "key": "mpettiford", "displayName": "Michael Pettiford", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing issue\r\n\r\nTested with Ti Studio build 2.0.0.201203182248\r\nTi Mob SDK 2.0.0.v20120319003254 hash r60b6da4c\r\nOSX Lion 10.7.3\r\niPhone 4 OS 5.0.1\r\n\r\n*Note that in instruments > allocations hit the info button and deselect the option for only track active allocations*\r\n\r\nVerified that the proxy is being released\r\n", "updateAuthor": { "name": "mpettiford", "key": "mpettiford", "displayName": "Michael Pettiford", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-19T10:25:25.000+0000", "updated": "2012-03-19T10:25:25.000+0000" }, { "id": "189121", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Reopening to fixversion", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-29T08:03:00.000+0000", "updated": "2012-03-29T08:03:00.000+0000" }, { "id": "191892", "author": { "name": "mpettiford", "key": "mpettiford", "displayName": "Michael Pettiford", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Reopening/closing to add/remove labels", "updateAuthor": { "name": "mpettiford", "key": "mpettiford", "displayName": "Michael Pettiford", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-04-19T13:18:28.000+0000", "updated": "2012-04-19T13:18:28.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }