{ "id": "88426", "key": "TIMOB-8172", "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": "13271", "description": "Release 2.1.0", "name": "Release 2.1.0", "archived": false, "released": true, "releaseDate": "2012-06-29" }, { "id": "13207", "name": "Sprint 2012-07", "archived": true, "released": true, "releaseDate": "2012-04-08" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-04-02T12:27:07.000+0000", "created": "2012-03-21T17:08:11.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "api", "module_memory", "qe-port" ], "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" }, "inwardIssue": { "id": "88953", "key": "TIMOB-8330", "fields": { "summary": "Android: Global variables causing memory leak on windows", "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" } }, "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": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2013-01-18T14:53:27.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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "h2. Problem\r\nMemory leaks when opening and closing a window including a tabGroup\r\n\r\nh2. Code and steps to reproduce\r\n{code:lang=javascript|title=app.js}\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 button = Ti.UI.createButton({\r\n title: \"create tabGroup\"\r\n});\r\n\r\nvar MY_TABGROUP = null;\r\n\r\nTitanium.App.addEventListener('tabGroupclosed', function(e) {\r\n Ti.API.debug('MY_TABGROUP close...');\r\n MY_TABGROUP = null;\r\n});\r\n\r\nbutton.addEventListener('click', function(e) {\r\n\r\n MY_TABGROUP = require('/myNewTabGroup').innerTabGroup();\r\n\r\n MY_TABGROUP.open({\r\n animated: true\r\n });\r\n\r\n});\r\n\r\n\r\n\r\nvar button2 = Ti.UI.createButton({\r\n\tbottom: 200,\r\n\ttitle:'show MY_TABGROUP'\r\n});\r\nbutton2.addEventListener('click', function(){\r\n\talert(MY_TABGROUP)\r\n});\r\nmainwin.add(button2);\r\n\r\n\r\nvar button3 = Ti.UI.createButton({\r\n\tbottom:5,\r\n\ttitle:'GC'\r\n});\r\nbutton3.addEventListener('click', function(){\r\n\t\tviews1 = [];\r\n \tviews2 = [];\r\n \tMY_TABGROUP=null;\r\n});\r\nmainwin.add(button3);\r\n\r\n\r\nmainwin.add(button);\r\n\r\nmainwin.open();\r\n{code}\r\n\r\n{code:lang=javascript|title=myNewTabGroup.js}\r\nexports.innerTabGroup = function() {\r\n\r\n var tabGroup = null;\r\n\r\n var win1 = null;\r\n var tab1 = null;\r\n var win2 = null;\r\n var tab2 = null;\r\n\r\n var views1 =[];\r\n var view1 = null;\r\n var views2 =[];\r\n var view2 = null;\r\n\r\n tabGroup = Titanium.UI.createTabGroup();\r\n\r\n win1 = Titanium.UI.createWindow({ \r\n title:'Tab 1',\r\n backgroundColor:'#fff'\r\n });\r\n\r\n for (var i=0; i < 600; i++) {\r\n view1 = Ti.UI.createView();\r\n views1.push(view1);\r\n win1.add(view1);\r\n }\r\n \r\n\r\n tab1 = Titanium.UI.createTab({ \r\n icon:'KS_nav_views.png',\r\n title:'Tab 1',\r\n window:win1\r\n });\r\n\r\n win2 = Titanium.UI.createWindow({ \r\n title:'Tab 2',\r\n backgroundColor:'#fff'\r\n });\r\n\r\n for (var i=0; i < 600; i++) {\r\n view2 = Ti.UI.createView();\r\n views2.push(view2);\r\n win2.add(view2);\r\n }\r\n\r\n tab2 = Titanium.UI.createTab({ \r\n icon:'KS_nav_ui.png',\r\n title:'Tab 2',\r\n window:win2\r\n });\r\n\r\n tabGroup.addTab(tab1); \r\n tabGroup.addTab(tab2); \r\n\r\n\r\n\r\n return tabGroup;\r\n\r\n};\r\n{code}\r\n\r\nSteps followed with allocated memory and # of objects:\r\n1. Run the app (memory 3144MB - #Objects 60,139) and click on 'create tabGroup' button (mem 8053 - Obj 148,156) \r\n2. Hit back button (mem 4457 - 91,059). Reference to MY_TABGROUP is still present and is still not GC\r\n3. Click the GC button to set MY_TABGROUP to null (mem 4234 - Obj 86,654)\r\n\r\n4. Click on create tabGroup button (mem 9007 - 172,396)\r\n5. Hit back button (5408 - 115,292)\r\n\r\nMemory increase in size subsequently repeating the steps.\r\n\r\nAttaching also the log file.\r\n\r\nh2. Additional info\r\nCustomer ticket: http://support-admin.appcelerator.com/display/APP-355811", "attachment": [ { "id": "26442", "filename": "leaksAndroidLog.txt", "author": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-21T17:08:11.000+0000", "size": 8452, "mimeType": "text/plain" } ], "flagged": false, "summary": "Android: memory leaks opening/closing tabGroups", "creator": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Android OS\r\ntested on TiSDK 2.0 latest CI, 1.8.2", "comment": { "comments": [ { "id": "188767", "author": { "name": "anikolaou@greekgeeks.com", "key": "anikolaou@greekgeeks.com", "displayName": "Athanasios Nikolaou", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Is there any progress in this issue???", "updateAuthor": { "name": "anikolaou@greekgeeks.com", "key": "anikolaou@greekgeeks.com", "displayName": "Athanasios Nikolaou", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-27T01:57:39.000+0000", "updated": "2012-03-27T01:57:39.000+0000" }, { "id": "188794", "author": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "body": "We are looking at this issue right now and should have a fix in next few days.", "updateAuthor": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-27T08:20:55.000+0000", "updated": "2012-03-27T08:20:55.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }