{ "id": "163011", "key": "TIMOB-23868", "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": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2017-06-17T13:19:19.000+0000", "created": "2016-09-06T01:33:04.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "ios" ], "versions": [ { "id": "17706", "name": "Release 5.4.0", "archived": false, "released": true, "releaseDate": "2016-08-11" } ], "issuelinks": [], "assignee": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2018-08-06T17:37:04.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "After releasing all the references to Ti.UI.View objects, Instruments shows TiUIView objects moving from Persistent to Transient correctly.\r\n\r\nBut it shows TiUIViewProxy objects keeping at Persistent column. As far as I know it could be due to a memory leak.\r\n\r\nWhen I set *use-jscore-framework* to false, all TiUIViewProxy goes to Transient as expected.\r\n\r\n*app.js*\r\n\r\n{code:javascript}\r\nvar w = Ti.UI.createWindow({ \r\n backgroundColor:'#fff'\r\n});\r\n\r\nvar s = Ti.UI.createScrollView({\r\n\ttop: 30,\r\n\tbottom: 0,\r\n\tlayout: 'vertical' \r\n});\r\nw.add(s);\r\n\r\nvar a,\r\n\ti, l,\r\n\tSIZE = 500;\r\n\r\nvar b1 = Ti.UI.createButton({\r\n\theight: 45,\r\n\twidth: '50%',\r\n\tcolor: 'blue',\r\n\ttitle:'create'\r\n});\r\nb1.addEventListener('click', function () {\r\n\tconsole.log('#creating ' + SIZE + ' views...');\r\n\ta = [];\r\n\ta.length = SIZE;\r\n\r\n\tfor (i=0, l=SIZE; i=0; i--) {\r\n\t\ts.remove(a[i]);\r\n\t}\r\n\ta = null;\r\n\tconsole.log('#done!');\r\n});\r\ns.add(b2);\r\n\r\nw.open();\r\n{code}\r\n\r\n*tiapp.xml*\r\n\r\n{code:xml}\r\n\r\n\r\n net.mqbc.leak\r\n Leak\r\n 1.0\r\n dirlei\r\n \r\n \r\n 2016 by dirlei\r\n appicon.png\r\n false\r\n MY_GUID\r\n dp\r\n false\r\n \r\n \t\r\n true\r\n \r\n \r\n UISupportedInterfaceOrientations~iphone\r\n \r\n UIInterfaceOrientationPortrait\r\n \r\n \r\n \r\n \r\n \r\n\t\t\r\n\t\t\t\r\n\t\t \t\r\n \r\n \r\n \r\n true\r\n true\r\n false\r\n \r\n 5.4.0.GA\r\n MY_APPC_ID\r\n\r\n{code}", "attachment": [ { "id": "62633", "filename": "Leak-1.png", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-06-11T12:16:35.000+0000", "size": 766615, "mimeType": "image/png" }, { "id": "62634", "filename": "Leak-2.png", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-06-11T12:16:34.000+0000", "size": 609554, "mimeType": "image/png" }, { "id": "62635", "filename": "No-Leak.png", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-06-11T12:16:33.000+0000", "size": 510494, "mimeType": "image/png" } ], "flagged": false, "summary": "iOS: Possible memory leak on TiUIViewProxy when use-jscore-framework is true", "creator": { "name": "dirleidionisio", "key": "dirleidionisio", "displayName": "Dirlei Dionísio", "active": true, "timeZone": "America/Sao_Paulo" }, "subtasks": [], "reporter": { "name": "dirleidionisio", "key": "dirleidionisio", "displayName": "Dirlei Dionísio", "active": true, "timeZone": "America/Sao_Paulo" }, "environment": "iPhone 6s (9.3) simulator\r\nApp CLI/SDK 5.4.0", "closedSprints": [ { "id": 903, "state": "closed", "name": "2017 Sprint 12 SDK", "startDate": "2017-06-05T00:15:46.290Z", "endDate": "2017-06-19T00:15:00.000Z", "completeDate": "2017-06-19T16:09:22.870Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "395358", "author": { "name": "dirleidionisio", "key": "dirleidionisio", "displayName": "Dirlei Dionísio", "active": true, "timeZone": "America/Sao_Paulo" }, "body": "[link Instruments video|https://www.dropbox.com/s/clenkvm635jxur3/instruments.m4v?dl=0]", "updateAuthor": { "name": "dirleidionisio", "key": "dirleidionisio", "displayName": "Dirlei Dionísio", "active": true, "timeZone": "America/Sao_Paulo" }, "created": "2016-09-06T01:40:42.000+0000", "updated": "2016-09-06T01:40:42.000+0000" }, { "id": "397873", "author": { "name": "nunocostapt", "key": "nunocostapt", "displayName": "Nuno Costa", "active": true, "timeZone": "Europe/Lisbon" }, "body": "The issue that I found is, when I passed big payload to the detail window for example, and that detail window is ScrollableView.\r\nThe UI is blocked for a few secs (min 3 sec) so after the details window is open.\r\n\r\n", "updateAuthor": { "name": "nunocostapt", "key": "nunocostapt", "displayName": "Nuno Costa", "active": true, "timeZone": "Europe/Lisbon" }, "created": "2016-10-03T11:24:15.000+0000", "updated": "2016-10-03T11:24:15.000+0000" }, { "id": "419462", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "In 6.0.4.GA I see this too: TiUIView is release but the TiUIViewProxy add up and are not moved to Transient", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-05-10T12:41:54.000+0000", "updated": "2017-05-10T12:41:54.000+0000" }, { "id": "421167", "author": { "name": "brentonhouse", "key": "brentonhouse", "displayName": "Brenton House", "active": true, "timeZone": "America/Chicago" }, "body": "[~hansknoechel] -- Any chance this might get fixed in a patch release before 6.2.0? Because we are updating more apps to use Hyperloop, the workaround of setting use-jscore-framework to false will no longer work for us.", "updateAuthor": { "name": "brentonhouse", "key": "brentonhouse", "displayName": "Brenton House", "active": true, "timeZone": "America/Chicago" }, "created": "2017-06-07T12:34:22.000+0000", "updated": "2017-06-07T12:34:22.000+0000" }, { "id": "421702", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "I've spend some time on this issue and tracked it down to the {{createProxy:forName:}} method which returns an auto-released object ({{\\[\\[\\[resultClass alloc] _initWithPageContext:context args:args] autorelease]}}). It stays in the {{Persistent}} column but deallocates after about 1:40 minutes - which makes sense to me because it's an autoreleased object that is garbage-collected after a while not being used. \r\n\r\nSo unless there is a reproducible case where the app actually crashes after some usage time, I cannot see something we should change at this point, although I still want to dig into this a bit more.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-06-11T12:11:23.000+0000", "updated": "2017-06-11T12:11:43.000+0000" }, { "id": "421746", "author": { "name": "brentonhouse", "key": "brentonhouse", "displayName": "Brenton House", "active": true, "timeZone": "America/Chicago" }, "body": "Thanks [~hansknoechel]! Is there a recommended way of cleaning up controllers/views when using {{popToRootWindow}}?\r\nhttps://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.iOS.NavigationWindow-method-popToRootWindow\r\n\r\nI can use the {{close}} event as a workaround with the iOS native back button but {{popToRootWindow}} seems to only fire the close event for the most recently opened window.", "updateAuthor": { "name": "brentonhouse", "key": "brentonhouse", "displayName": "Brenton House", "active": true, "timeZone": "America/Chicago" }, "created": "2017-06-12T17:15:17.000+0000", "updated": "2017-06-12T17:15:17.000+0000" }, { "id": "421805", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Not sure how it's related (it may if you use the specific method, not then it would probably leak with jscore/no-jscore). \r\n\r\nRegardless of that, from what I tested during implementing the {{popToRootWindow}} method was that it was cleaned up properly, but there is a good chance that the proxies are still internally registered, which could be solved by looping through the child-controllers and nuke them down manually - which would also fire the {{close}} event of all windows. \r\n\r\nI see that we could do a ticket about that, but for now, I'd rather want to ensure we have {{no leak}} here and fix it otherwise. Can you see that the memory gets deallocated after a few minutes as well or does it stay?", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-06-12T19:39:58.000+0000", "updated": "2017-06-12T19:39:58.000+0000" }, { "id": "421816", "author": { "name": "brentonhouse", "key": "brentonhouse", "displayName": "Brenton House", "active": true, "timeZone": "America/Chicago" }, "body": "The popToRootWindow was just part of the test case I was using. When I remove that as part of the test, everything seems to reset back to original values after a min or so. When the popToRootWindow is used, everything but the controls on the intermediate windows (between root and the last window open) are cleaned up. I will create a separate test case for popToRootWindow and see if it needs further looking into. Thanks for your help!!\r\n\r\n", "updateAuthor": { "name": "brentonhouse", "key": "brentonhouse", "displayName": "Brenton House", "active": true, "timeZone": "America/Chicago" }, "created": "2017-06-12T20:57:26.000+0000", "updated": "2017-06-12T20:57:26.000+0000" }, { "id": "421817", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Ok, will investigate that one in a separate one (feel free to raise one, I'd create it tomorrow otherwise). [~michael], how about your test-case, did it (auto-)release it or did it stay in the persistent-state?", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-06-12T21:03:48.000+0000", "updated": "2017-06-12T21:03:48.000+0000" }, { "id": "422202", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Removing 6.1.1 milestone for now, based on the above findings. For the {{popToRootWindow}} method, I have created TIMOB-24843 to take a look into. Both changes described there are related and can be implemented together. I scheduled that one for 6.2.0 for now, but it will likely move up to 6.1.1 or 6.1.2 depending on the ticket-load.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-06-17T13:19:07.000+0000", "updated": "2017-06-17T13:19:07.000+0000" }, { "id": "439935", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing as invalid. If incorrect, please reopen.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-08-06T17:37:04.000+0000", "updated": "2018-08-06T17:37:04.000+0000" } ], "maxResults": 11, "total": 11, "startAt": 0 } } }