{ "id": "106807", "key": "ALOY-435", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [], "resolution": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2013-03-08T23:05:48.000+0000", "created": "2012-12-19T17:57:45.000+0000", "priority": null, "labels": [ "Allocations", "Alloy", "Memory", "UI" ], "versions": [], "issuelinks": [], "assignee": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2014-01-29T00:07:02.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": "12329", "name": "Runtime", "description": "Generic bucket for uncategorized runtime issues" } ], "description": "The attached project has only 1 window and 1 view with 10 buttons so that you could see the UI count in allocations.\r\n\r\nIn the attached screen1.png you will see view1 with the 10 buttons. \r\n\r\n\r\nIn the attached screen2.png - If you click the remove myself button you will see that the view is removed and nulls the global reference to the view and you are returned to the window (white). I stayed on the window for a long time on a couple of tests and it never cleaned up the UI objects from view 1.\r\n\r\nIn attached screen3.png I opened view1 and clicked the remove myself button and the objects where cleaned up almost instantly. I can repeat this action over and over again and the objects clean up flawlessly.\r\n\r\nThis confirms that if you went to a view and never returned to it, it would never be properly cleaned up. \r\n\r\nHere is a link to the simplified project and made it as \"hello world\" as I could in hopes of making the issue easier to spot.\r\n\r\nhttp://wwww.appdesigngeeks.com/simpleviewtest.zip\r\n\r\nBelow is the simplified code from Alloy.js that does the open and close of view1\r\n\r\nAlloy.globals.VARS = {\r\n globalParent: null, // Store ref to Parent Window of App\r\n globalCurrentView: null, // Store ref to current view being shown\r\n};\r\n\r\nAlloy.globals.GVUpdate = function(inName, inValue)\r\n{\r\n Alloy.globals.VARS[inName] = inValue;\r\n};\r\n\r\nAlloy.globals.GVOpenViewNew = function(viewName)\r\n{\r\n var openingview = Alloy.createController(viewName); // create controller\r\n Alloy.globals.VARS.globalParent.add(openingview.getView());\r\n openingview.init();\r\n Alloy.globals.VARS['globalCurrentView'] = openingview; \r\n};\r\n\r\nAlloy.globals.CloseView = function()\r\n{\r\n Alloy.globals.VARS.globalParent.remove(Alloy.globals.VARS.globalCurrentView.getView()); // Remove Current View from Parent\r\n Alloy.globals.GVUpdate(\"globalCurrentView\", null); // Cleanup by Releasing resources and memory for current view\r\n};\r\n\r\n", "attachment": [ { "id": "34270", "filename": "screen1 .png", "author": { "name": "appdesigngeeks", "key": "appdesigngeeks", "displayName": "AppDesign", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-12-19T17:57:45.000+0000", "size": 388659, "mimeType": "image/png" }, { "id": "34271", "filename": "screen2.png", "author": { "name": "appdesigngeeks", "key": "appdesigngeeks", "displayName": "AppDesign", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-12-19T17:57:45.000+0000", "size": 363100, "mimeType": "image/png" }, { "id": "34272", "filename": "screen3.png", "author": { "name": "appdesigngeeks", "key": "appdesigngeeks", "displayName": "AppDesign", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-12-19T17:57:45.000+0000", "size": 360694, "mimeType": "image/png" } ], "flagged": false, "summary": "UI Object Allocations with Alloy and Titanium Studio", "creator": { "name": "appdesigngeeks", "key": "appdesigngeeks", "displayName": "AppDesign", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "appdesigngeeks", "key": "appdesigngeeks", "displayName": "AppDesign", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Titanium Studio, build: 3.0.1.201211202043 or higher\r\nTitanium SDK Version: 3.0.0\r\nTitanium CLI Version: 3.0.16\r\nAlloy Version: 0.3.2\r\n", "comment": { "comments": [ { "id": "233751", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The linked project is not a valid download link so this is impossible to test. It's also worth noting that memory is not freed the instant that you remove and null a resource. Garbage collection needs to kick in before any of that will happen and that's probably why as you continue to navigate around your app that it is freed. \r\n\r\nUpdate the project link and we can revisit.", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-01-09T17:08:49.000+0000", "updated": "2013-01-09T17:08:49.000+0000" }, { "id": "233784", "author": { "name": "appdesigngeeks", "key": "appdesigngeeks", "displayName": "AppDesign", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi Tony,\r\n\r\nSorry about the link, it had an extra w in the www. Here is the correct link http://www.appdesigngeeks.com/simpleviewtest.zip.\r\n\r\nI understand that garbage collection does not always kick in at a certain time or always right away. I have let the screen sit there for hours and the view never gets cleaned up. I also have another example with more views and if you navigate to a 4th view and then back through the app and never return to the 4th view it will never get cleaned up no matter how many times I navigate around the rest of the views (ex. view1, view2, and view3) in the sample app or how long I let the app run.\r\n\r\nHope this helps\r\n\r\nThanks\r\n\r\n\r\n", "updateAuthor": { "name": "appdesigngeeks", "key": "appdesigngeeks", "displayName": "AppDesign", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-01-10T08:04:50.000+0000", "updated": "2013-01-10T08:04:50.000+0000" }, { "id": "233787", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Is the \"leak\" growing over time though? It sounds like this is a discrete example that doesn't in fact grow but instead represents the memory footprint of your app as it relates to the timing of the garbage collection. I guess what I'm asking is does the number of views in memory grow over time, or is it just this instance that stays there? Because if it doesn't grow, it's not really a leak. If it does grow, are you able to recreate the issue without your custom logic? I have not been able to recreate any leaks without using the custom view management.", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-01-10T08:28:46.000+0000", "updated": "2013-01-10T08:28:46.000+0000" }, { "id": "241445", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Will reopen if more details are given", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-08T23:05:48.000+0000", "updated": "2013-03-08T23:05:48.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }