{ "id": "88556", "key": "TIMOB-8286", "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" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-07-09T03:44:51.000+0000", "created": "2012-03-23T01:04:54.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "api", "module_tabgroup", "qe-testadded" ], "versions": [ { "id": "13070", "description": "Release 1.8 Service Pack 2", "name": "Release 1.8.2", "archived": true, "released": true, "releaseDate": "2012-02-29" } ], "issuelinks": [ { "id": "22340", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "104060", "key": "TIMOB-11605", "fields": { "summary": "Android: TabGroup - Black screen appears on launch", "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": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2012-10-29T21:59:32.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": "h3. Problem\r\n\r\n\r\nI've noticed TabGroup memory leak. When local JS object has a property that references TabGroup, it never gets released.\r\n\r\n\r\nSame test case that uses heavyweight Window instead of TabGroup does not have that problem.\r\n\r\n\r\nh3. Test case\r\n\r\n\r\nUsing TabGroup (produces memory leak)\r\n\r\n{code}\r\n(function() {\r\n \r\n var create = function() {\r\n \r\n var tabGroupWrapper = {}, tabWrapper = {}, winWrapper = {}, tableViewWrapper = {}, buttonWrapper = {};\r\n \r\n tabGroupWrapper.Element = Ti.UI.createTabGroup();\r\n \r\n winWrapper.Element = Ti.UI.createWindow({ navBarHidden: true, backgroundColor: '#fc9', layout: 'vertical' });\r\n \r\n tabWrapper.Element = Ti.UI.createTab({ title: 'Test', window: winWrapper.Element });\r\n \r\n tabGroupWrapper.Element.addTab(tabWrapper.Element);\r\n \r\n tableViewWrapper.Element = Ti.UI.createTableView();\r\n \r\n var data = [];\r\n \r\n for (var i = 1; i <= 500; ++i) {\r\n data.push({ title: 'Row ' + i});\r\n }\r\n \r\n tableViewWrapper.Element.setData(data);\r\n \r\n buttonWrapper.Element = Ti.UI.createButton({\r\n title: 'Create new tabgroup!'\r\n });\r\n \r\n buttonWrapper.Element.addEventListener('click', function() {\r\n create();\r\n });\r\n \r\n winWrapper.Element.add(buttonWrapper.Element);\r\n winWrapper.Element.add(tableViewWrapper.Element);\r\n \r\n tabGroupWrapper.Element.setActiveTab(0);\r\n \r\n tabGroupWrapper.Element.open();\r\n \r\n };\r\n \r\n create();\r\n \r\n \r\n})();\r\n{code}\r\n\r\n\r\nUsing Window (does not produce memory leak)\r\n\r\n{code}\r\n(function() {\r\n \r\n var create = function() {\r\n \r\n var winWrapper = {}, tableViewWrapper = {}, buttonWrapper = {};\r\n \r\n winWrapper.Element = Ti.UI.createWindow({ navBarHidden: true, backgroundColor: '#fc9', layout: 'vertical' });\r\n \r\n tableViewWrapper.Element = Ti.UI.createTableView();\r\n \r\n var data = [];\r\n \r\n for (var i = 1; i <= 500; ++i) {\r\n data.push({ title: 'Row ' + i});\r\n }\r\n \r\n tableViewWrapper.Element.setData(data);\r\n \r\n buttonWrapper.Element = Ti.UI.createButton({\r\n title: 'Create new window!'\r\n });\r\n \r\n buttonWrapper.Element.addEventListener('click', function() {\r\n create();\r\n });\r\n \r\n winWrapper.Element.add(buttonWrapper.Element);\r\n winWrapper.Element.add(tableViewWrapper.Element);\r\n \r\n winWrapper.Element.open();\r\n \r\n };\r\n \r\n create();\r\n \r\n \r\n})();\r\n{code}\r\n\r\n\r\nh4. Steps\r\nTo see this issue, run first test case, click on the button and then close tabgroup by using hardware back-button. Repeat that and observe heap size. You should notice that heap size increases and that memory is not being released.\r\n\r\n\r\nOn the other hand, by running second example (the one that uses Window) and doing the same thing (open -> back -> open ...) you should see that memory is being released.", "attachment": [], "flagged": false, "summary": "Android: TabGroup memory leak", "creator": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "environment": "* Titanium SDK version: 2.0.0 (03/22/12 23:17 bc1a32c)\r\n* v8\r\n* Android 3.1 (on Thinkpad Tablet device)\r\n* Windows XP", "comment": { "comments": [ { "id": "188747", "author": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "updateAuthor": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2012-03-26T23:45:40.000+0000", "updated": "2012-03-26T23:45:40.000+0000" }, { "id": "191990", "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 please???", "updateAuthor": { "name": "anikolaou@greekgeeks.com", "key": "anikolaou@greekgeeks.com", "displayName": "Athanasios Nikolaou", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-04-20T06:09:09.000+0000", "updated": "2012-04-20T06:09:09.000+0000" }, { "id": "194226", "author": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "Seems it's forgotten. :(", "updateAuthor": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2012-05-09T00:05:51.000+0000", "updated": "2012-05-09T00:05:51.000+0000" }, { "id": "194227", "author": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "Or not, thanks Neeraj. :)", "updateAuthor": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2012-05-09T00:21:39.000+0000", "updated": "2012-05-09T00:21:39.000+0000" }, { "id": "194640", "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 please???", "updateAuthor": { "name": "anikolaou@greekgeeks.com", "key": "anikolaou@greekgeeks.com", "displayName": "Athanasios Nikolaou", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-05-14T06:13:24.000+0000", "updated": "2012-05-14T06:13:24.000+0000" }, { "id": "194897", "author": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Should I be backing out of the application then relaunching it?\r\nThere is no other window once the tab group window closes or a button to re-open the tab group.", "updateAuthor": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-05-15T14:28:54.000+0000", "updated": "2012-05-15T14:28:54.000+0000" }, { "id": "194961", "author": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "Hello Josh.\r\n\r\n\r\nNo, you should press \"Create new tabgroup\" button and then press hardware back-button and repeat that.\r\n\r\n\r\nBut, now I tested again with latest CI build and this issue seem to be solved. So, it can be marked as resolved.", "updateAuthor": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2012-05-16T01:39:53.000+0000", "updated": "2012-05-16T01:39:53.000+0000" }, { "id": "194996", "author": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing as the issue can no longer be reproduced.", "updateAuthor": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-05-16T08:48:56.000+0000", "updated": "2012-05-16T08:48:56.000+0000" }, { "id": "195693", "author": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This issue has been resolved in 2.1.0 release. It probably was part of another fix. ", "updateAuthor": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-05-22T20:55:34.000+0000", "updated": "2012-05-22T20:55:34.000+0000" }, { "id": "199905", "author": { "name": "psingh", "key": "psingh", "displayName": "Payminder Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Titanium Studio: 2.1.0.201206221045\r\nMobile SDK: 2.1.0.v20120622174154\r\nOS: X Lion\r\nDevice: Samsung Galaxy \r\n\r\nCan't reproduce.\r\n\r\nFind no changes memory leak information in VM Heap and any changes in Sys Info: Memory Pie chart.", "updateAuthor": { "name": "psingh", "key": "psingh", "displayName": "Payminder Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-23T12:09:09.000+0000", "updated": "2012-06-23T12:09:09.000+0000" }, { "id": "202056", "author": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Re-opening to edit label", "updateAuthor": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-09T03:44:15.000+0000", "updated": "2012-07-09T03:44:15.000+0000" } ], "maxResults": 11, "total": 11, "startAt": 0 } } }