{ "id": "88953", "key": "TIMOB-8330", "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": [], "resolution": null, "resolutiondate": null, "created": "2012-03-27T11:26:27.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [ { "id": "12593", "name": "Release 2.0.0", "archived": false, "released": true, "releaseDate": "2012-03-30" }, { "id": "13070", "description": "Release 1.8 Service Pack 2", "name": "Release 1.8.2", "archived": true, "released": true, "releaseDate": "2012-02-29" } ], "issuelinks": [ { "id": "16123", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "88426", "key": "TIMOB-8172", "fields": { "summary": "Android: memory leaks opening/closing tabGroups", "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": null, "updated": "2018-03-06T18:57:53.000+0000", "status": { "description": "This issue was once resolved, but the resolution was deemed incorrect. From here issues are either marked assigned or resolved.", "name": "Reopened", "id": "4", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "Assigning window to a global variable causes that window to leak when closing via back button.\r\nSteps to reproduce:\r\n1. Run this code: \r\n{code}\r\nvar mainwin = Ti.UI.createWindow({\r\n title:'TEST WINDOW',\r\n backgroundColor:'#fff',\r\n fullscreen:true, \r\n statusBarHidden: true,\r\n navBarHidden:true, \r\n exitOnClose:true\r\n});\r\n\r\nvar MY_WINDOW = null;\r\n\r\nvar button1 = Ti.UI.createButton({\r\n top: 100,\r\n title: \"create Window\"\r\n});\r\n\r\nbutton1.addEventListener('click', function(e) {\r\n \r\n MY_WINDOW = createWin(); \r\n MY_WINDOW.open();\r\n //createWin();\r\n \r\n});\r\n\r\nmainwin.add(button1);\r\nmainwin.open();\r\n\r\n\r\nfunction createWin() {\r\n var win = null;\r\n var v = [];\r\n win = Ti.UI.createWindow({\r\n fullscreen:'true',\r\n backgroundColor:'#fff'\r\n });\r\n \r\n for (var i=0; i < 600; i++) {\r\n var view1 = Ti.UI.createView();\r\n v.push(view1);\r\n win.add(view1);\r\n }\r\n return win;\r\n //win.open();\r\n}\r\n\r\n\r\n{code}\r\n2. Click on 'create Window' button.\r\n3. Click back\r\n4. Repeat and observe memory in DDMS\r\n\r\nNOTE: if you don't assign global variable, then it won't leak. Try moving the open() call into createWin() function and don't return anything.\r\n", "attachment": [], "flagged": false, "summary": "Android: Global variables causing memory leak on windows", "creator": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "189307", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This issue is due to V8 GC lag. Closing as invalid.", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-30T10:41:22.000+0000", "updated": "2012-03-30T10:41:22.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }