{ "id": "87443", "key": "TIMOB-7897", "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-07-05T00:21:59.000+0000", "created": "2012-03-06T13:50:48.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "module_memory", "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": "15669", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "85561", "key": "TIMOB-7434", "fields": { "summary": "Android: V8 & Rhino - keyDispatchingTimedOut logged then crash", "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": "Critical", "id": "1" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "15798", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "88093", "key": "TIMOB-8063", "fields": { "summary": "Android: Backing out of a window with its own activity while it's still opening leads to bad state.", "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-07-05T13:59:35.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": "Windows appear to be leaking memory by not properly cleaning up\r\nafter they have been closed. This only affects \"heavy\" windows that have their own activity.\r\n\r\nh3. Test Case: Opening a window and adding many child views.\r\n\r\nRun the application and click the button to open a window.\r\nWait for an alert dialog to popup telling you its okay to back out now.\r\nHit the back button to close out the window. Repeat this process.\r\n\r\nExpected: Memory usage should peak and remain steady.\r\nActual: Memory usages constantly rises until out of memory crash occurs.\r\n\r\n{code:javascript}\r\nfunction mainViews() {\r\n \r\n var newWin = Ti.UI.createWindow({ navBarHidden: true });\r\n \r\n Ti.API.info('****** mainViews function has started ******');\r\n var views =[];\r\n var view = null;\r\n for (var i=0; i < 500; i++) {\r\n view = Ti.UI.createView();\r\n views.push(view);\r\n newWin.add(view);\r\n }\r\n \r\n \r\n newWin.open();\r\n \r\n alert(\"You may click back now.\");\r\n \r\n Ti.API.info('Titanium views created and added to array');\r\n Ti.API.info('****** mainViews function has stopped ******');\r\n}\r\n\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: \"white\"\r\n});\r\n\r\nvar button = Ti.UI.createButton({\r\n title: \"create 5k views\"\r\n});\r\nbutton.addEventListener(\"click\", function(e) {\r\n mainViews();\r\n Ti.API.info('Available memory: ' + Ti.Platform.availableMemory);\r\n});\r\n\r\nwin.add(button);\r\nwin.open();\r\n{code}", "attachment": [ { "id": "26295", "filename": "crashLog.txt", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-03-16T12:08:24.000+0000", "size": 7961, "mimeType": "text/plain" } ], "flagged": false, "summary": "Android: Memory leak by windows not properly cleaning up after close.", "creator": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "186306", "author": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Sent [Pull Request #1662|https://github.com/appcelerator/titanium_mobile/pull/1662] to resolve issue.\r\n\r\nThis works around a bug in older Android versions which appear to \"leak\" Messenger that are\r\npassed within an Intent's extra. To reduce the affects of this leak, moved Handler callback implementation\r\ninto a static, nested class. This allows the \"expensive\" TiUIActivityWindow to get collected and\r\nreduces memory leak to a very minimal level.\r\n", "updateAuthor": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-13T14:03:57.000+0000", "updated": "2012-03-13T14:03:57.000+0000" }, { "id": "186769", "author": { "name": "anikolaou@greekgeeks.com", "key": "anikolaou@greekgeeks.com", "displayName": "Athanasios Nikolaou", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi,\r\n\r\nI am a little bit confused... \r\nIs this ticket really resolved?\r\n\r\nThe above provided test case crashes on emulator after 2 clicks (i used continuous builds - version 2.0.0.v20120315091738). \r\n\r\nThank you in advance,\r\nAthanasios Nikolaou", "updateAuthor": { "name": "anikolaou@greekgeeks.com", "key": "anikolaou@greekgeeks.com", "displayName": "Athanasios Nikolaou", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-16T02:22:22.000+0000", "updated": "2012-03-16T02:22:22.000+0000" }, { "id": "186838", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Reopening bug. Was able to reproduce bug on:\r\n\r\nSDK build: 2.0.0.v20120316104738\r\nRuntime: v8\r\nTitanium Studio, build: 2.0.0.201203152033\r\nDevice: Emulator Google API 2.2\r\n\r\nSee crashLog.txt\r\n\r\nNote:\r\n* No memory crash when running on Emulator Google API 2.2, rhino\r\n* No memory crash when running on device Nexus S (2.3.6), v8 and rhino ", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-03-16T12:07:25.000+0000", "updated": "2012-03-16T12:07:41.000+0000" }, { "id": "186841", "author": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This test case is probably too extreme for emulator (it has a global reference limit of only 2000).\r\nIf you lower the number of views to something less intense (say 500) it might perform better.\r\nLooking at the crash log looks like you had 1000 Phantom references. These are objects that are marked, but not\r\nyet swept away by the GC.", "updateAuthor": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-16T12:17:46.000+0000", "updated": "2012-03-16T12:17:46.000+0000" }, { "id": "186854", "author": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Going to review this closer and determine if the phantom references are caused by a bug in our platform or just due to Dalvik's GC.", "updateAuthor": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-16T13:05:38.000+0000", "updated": "2012-03-16T13:05:38.000+0000" }, { "id": "186862", "author": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Update test case to only create 500 views each time. Also added an alert to notify you\r\nonce all views have been added to the window. If you try backing out of the activity for the new window\r\nwill it is opening, we get into a bad state. I'll rise a separate issue to review this behavior\r\nand how we should address it.\r\n\r\nAfter lowering the view count to 500 and only backing out of the window after I get the \"alert\"\r\nI see the gref count on emulator staying steady and bellow the \"limit\".", "updateAuthor": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-16T13:24:30.000+0000", "updated": "2012-03-16T13:24:30.000+0000" }, { "id": "186971", "author": { "name": "mculpepper", "key": "mculpepper", "displayName": "Marshall Culpepper", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Resolving since TIMOB-8063 can no longer be reproduced, and test case was updated for emulator use cases", "updateAuthor": { "name": "mculpepper", "key": "mculpepper", "displayName": "Marshall Culpepper", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-18T11:39:00.000+0000", "updated": "2012-03-18T11:39:00.000+0000" }, { "id": "187064", "author": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested with Emulator 2.2. Clicked on create 5k view 10 times and did not get a crash. Tested with 2.0.0.v20120319003254 and studio: 2.0.0.201203182248", "updateAuthor": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-19T09:17:11.000+0000", "updated": "2012-03-19T09:17:11.000+0000" }, { "id": "201527", "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-05T00:21:30.000+0000", "updated": "2012-07-05T00:21:30.000+0000" } ], "maxResults": 9, "total": 9, "startAt": 0 } } }