{ "id": "160367", "key": "TIMOB-23435", "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": "17706", "name": "Release 5.4.0", "archived": false, "released": true, "releaseDate": "2016-08-11" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-07-27T18:55:30.000+0000", "created": "2016-05-19T18:56:56.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-31T22:16:38.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": "13715", "name": "Hyperloop", "description": "Hyperloop project" }, { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "attachment": [ { "id": "59814", "filename": "Screen Shot 2016-07-18 at 11.09.09 AM.png", "author": { "name": "jlongton", "key": "jlongton", "displayName": "Josh Longton", "active": true, "timeZone": "Europe/London" }, "created": "2016-07-18T18:23:36.000+0000", "size": 822455, "mimeType": "image/png" } ], "flagged": false, "summary": "Hyperloop: iOS Memory Leak", "creator": { "name": "sophrinix", "key": "sophrinix", "displayName": "Andrew McElroy", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "sophrinix", "key": "sophrinix", "displayName": "Andrew McElroy", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "closedSprints": [ { "id": 682, "state": "closed", "name": "2016 Sprint 15 SDK", "startDate": "2016-07-16T00:19:20.819Z", "endDate": "2016-07-30T00:19:00.000Z", "completeDate": "2016-08-01T04:40:11.421Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "386895", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~sophrinix] Are you \"only\" having the issues with the Autolayout-API or even without it? It would be good to have an actual video to see how it increases. I will try to setup something similar.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-05-26T13:38:34.000+0000", "updated": "2016-05-26T13:38:34.000+0000" }, { "id": "386900", "author": { "name": "sophrinix", "key": "sophrinix", "displayName": "Andrew McElroy", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Any iOS HL example leaks memory. Any time you require HL objects, you are leaking, I think. Just run the Instruments Leak tool on the iOS sim build to see what I am talking about. I did a video of this back in Feb. https://www.dropbox.com/s/i0yxar3dxrly2yu/kroll-context-memory-leak-with-hyperloop.mp4?dl=0 ", "updateAuthor": { "name": "sophrinix", "key": "sophrinix", "displayName": "Andrew McElroy", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-05-26T14:50:52.000+0000", "updated": "2016-05-26T14:50:52.000+0000" }, { "id": "389545", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "[~hansknoechel] This may sound crazy but. I used the latest 1.2.3 Hyperloop module on github, and I don't see a single leak. Neither on a new app, nor on the hyperloop-example.\r\n\r\nenvironment:\r\nhyperloop: 1.2.3\r\nTi SDK : 5.4.0.v20160519143319\r\nXcode 7.3.1\r\n\r\n", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-06-30T07:03:54.000+0000", "updated": "2016-06-30T07:03:54.000+0000" }, { "id": "389577", "author": { "name": "sophrinix", "key": "sophrinix", "displayName": "Andrew McElroy", "active": true, "timeZone": "America/Los_Angeles" }, "body": "It is still leaking. I cloned down a copy of hyperloop-examples and grabbed that exact 1.2.3 version of hyperloop module from releases. I'll upload a video and a new trace in the next hour or so.", "updateAuthor": { "name": "sophrinix", "key": "sophrinix", "displayName": "Andrew McElroy", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-06-30T14:16:18.000+0000", "updated": "2016-06-30T14:16:18.000+0000" }, { "id": "390923", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "[~cng], Will do.", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-07-18T17:40:53.000+0000", "updated": "2016-07-18T17:40:53.000+0000" }, { "id": "390927", "author": { "name": "jlongton", "key": "jlongton", "displayName": "Josh Longton", "active": true, "timeZone": "Europe/London" }, "body": "[~cng] I am able to reproduce this issue, It happens upon opening most of the items in the sample application.\r\n\r\nh2. ENV\r\niOS Simulator (9.3)
\r\n
Mac OSX El Capitan 10.11.5 \r\nStudio: 4.7.0.201607130543\r\n
Ti SDK: 5.4.0.v20160713141635\r\nHyperloop: 1.2.3 (Pulled from master and built today)\r\n
Appc NPM: 4.2.7\r\nAppc CLI: 5.4.0-31\r\nNode v4.4.4\r\n\r\nh2. Leaked objects from auto layout (Complete list [Here|https://gist.github.com/longton95/b764a42e442821ce0bb3b14b58790b09])\r\n{code:java}\r\nLeaked Object,#\tAddress\tSize\tResponsible Library\tResponsible Frame\r\n__NSCFString,1\t0x7f81924994b0\t64\tHyperloop_Sample\tNSStringFromTiStringRef\r\n\r\n\r\nLeaked Object,#\tAddress\tSize\tResponsible Library\tResponsible Frame\r\n__NSCFString,1\t0x7f8193da6b30\t32\tHyperloop_Sample\tNSStringFromTiStringRef\r\n\r\n\r\nLeaked Object,#\tAddress\tSize\tResponsible Library\tResponsible Frame\r\n__NSCFString,15\t< multiple >\t784\tHyperloop_Sample\tNSStringFromTiStringRef\r\n __NSCFString,1\t0x7f8192461db0\t32\tHyperloop_Sample\tNSStringFromTiStringRef\r\n __NSCFString,1\t0x7f81924994f0\t48\tHyperloop_Sample\tNSStringFromTiStringRef\r\n __NSCFString,1\t0x7f8193da8330\t32\tHyperloop_Sample\tNSStringFromTiStringRef\r\n __NSCFString,1\t0x7f8193da8550\t48\tHyperloop_Sample\tNSStringFromTiStringRef\r\n __NSCFString,1\t0x7f8193da8710\t32\tHyperloop_Sample\tNSStringFromTiStringRef\r\n __NSCFString,1\t0x7f8193da91e0\t96\tHyperloop_Sample\tNSStringFromTiStringRef\r\n __NSCFString,1\t0x7f8193da9310\t32\tHyperloop_Sample\tNSStringFromTiStringRef\r\n __NSCFString,1\t0x7f8193da93f0\t48\tHyperloop_Sample\tNSStringFromTiStringRef\r\n __NSCFString,1\t0x7f8193da9a30\t32\tHyperloop_Sample\tNSStringFromTiStringRef\r\n __NSCFString,1\t0x7f8193da9e50\t96\tHyperloop_Sample\tNSStringFromTiStringRef\r\n __NSCFString,1\t0x7f8193da9f40\t32\tHyperloop_Sample\tNSStringFromTiStringRef\r\n __NSCFString,1\t0x7f8193daa0d0\t96\tHyperloop_Sample\tNSStringFromTiStringRef\r\n __NSCFString,1\t0x7f8193daa180\t96\tHyperloop_Sample\tNSStringFromTiStringRef\r\n __NSCFString,1\t0x7f8193daa2f0\t32\tHyperloop_Sample\tNSStringFromTiStringRef\r\n __NSCFString,1\t0x7f8193daa360\t32\tHyperloop_Sample\tNSStringFromTiStringRef\r\n\r\n\r\nLeaked Object,#\tAddress\tSize\tResponsible Library\tResponsible Frame\r\n__NSCFString,1\t0x7f8192461db0\t32\tHyperloop_Sample\tNSStringFromTiStringRef\r\n\r\n\r\nLeaked Object,#\tAddress\tSize\tResponsible Library\tResponsible Frame\r\n__NSCFString,1\t0x7f81924994f0\t48\tHyperloop_Sample\tNSStringFromTiStringRef\r\n\r\n\r\nLeaked Object,#\tAddress\tSize\tResponsible Library\tResponsible Frame\r\n__NSCFString,1\t0x7f8193da8330\t32\tHyperloop_Sample\tNSStringFromTiStringRef\r\n\r\n\r\nLeaked Object,#\tAddress\tSize\tResponsible Library\tResponsible Frame\r\n__NSCFString,1\t0x7f8193da8550\t48\tHyperloop_Sample\tNSStringFromTiStringRef\r\n\r\n\r\nLeaked Object,#\tAddress\tSize\tResponsible Library\tResponsible Frame\r\n__NSCFString,1\t0x7f8193da8710\t32\tHyperloop_Sample\tNSStringFromTiStringRef\r\n\r\n\r\nLeaked Object,#\tAddress\tSize\tResponsible Library\tResponsible Frame\r\n__NSCFString,1\t0x7f8193da91e0\t96\tHyperloop_Sample\tNSStringFromTiStringRef\r\n\r\n\r\nLeaked Object,#\tAddress\tSize\tResponsible Library\tResponsible Frame\r\n__NSCFString,1\t0x7f8193da9310\t32\tHyperloop_Sample\tNSStringFromTiStringRef\r\n\r\n\r\nLeaked Object,#\tAddress\tSize\tResponsible Library\tResponsible Frame\r\n__NSCFString,1\t0x7f8193da93f0\t48\tHyperloop_Sample\tNSStringFromTiStringRef\r\n\r\n\r\nLeaked Object,#\tAddress\tSize\tResponsible Library\tResponsible Frame\r\n__NSCFString,1\t0x7f8193da9a30\t32\tHyperloop_Sample\tNSStringFromTiStringRef\r\n\r\n\r\nLeaked Object,#\tAddress\tSize\tResponsible Library\tResponsible Frame\r\n__NSCFString,1\t0x7f8193da9e50\t96\tHyperloop_Sample\tNSStringFromTiStringRef\r\n\r\n\r\nLeaked Object,#\tAddress\tSize\tResponsible Library\tResponsible Frame\r\n__NSCFString,1\t0x7f8193da9f40\t32\tHyperloop_Sample\tNSStringFromTiStringRef\r\n\r\n\r\nLeaked Object,#\tAddress\tSize\tResponsible Library\tResponsible Frame\r\n__NSCFString,1\t0x7f8193daa0d0\t96\tHyperloop_Sample\tNSStringFromTiStringRef\r\n\r\n\r\nLeaked Object,#\tAddress\tSize\tResponsible Library\tResponsible Frame\r\n__NSCFString,1\t0x7f8193daa180\t96\tHyperloop_Sample\tNSStringFromTiStringRef\r\n\r\n\r\nLeaked Object,#\tAddress\tSize\tResponsible Library\tResponsible Frame\r\n__NSCFString,1\t0x7f8193daa2f0\t32\tHyperloop_Sample\tNSStringFromTiStringRef\r\n\r\n\r\nLeaked Object,#\tAddress\tSize\tResponsible Library\tResponsible Frame\r\n__NSCFString,1\t0x7f8193daa360\t32\tHyperloop_Sample\tNSStringFromTiStringRef\r\n\r\n\r\nLeaked Object,#\tAddress\tSize\tResponsible Library\tResponsible Frame\r\nKrollObject,1\t0x7f81926056c0\t80\tHyperloop_Sample\t-[KrollContext main]\r\n\r\n\r\nLeaked Object,#\tAddress\tSize\tResponsible Library\tResponsible Frame\r\n__NSCFString,1\t0x7f8193da9170\t48\tHyperloop_Sample\tNSStringFromTiStringRef\r\n\r\n{code}\r\n!Screen Shot 2016-07-18 at 11.09.09 AM.png|thumbnail!\r\n", "updateAuthor": { "name": "jlongton", "key": "jlongton", "displayName": "Josh Longton", "active": true, "timeZone": "Europe/London" }, "created": "2016-07-18T18:23:14.000+0000", "updated": "2016-07-18T18:32:44.000+0000" }, { "id": "390963", "author": { "name": "jlongton", "key": "jlongton", "displayName": "Josh Longton", "active": true, "timeZone": "Europe/London" }, "body": "Using another build, I was able to run the example application without getting any leaks.\r\nWe will continue to investigate to see what is happening. ", "updateAuthor": { "name": "jlongton", "key": "jlongton", "displayName": "Josh Longton", "active": true, "timeZone": "Europe/London" }, "created": "2016-07-19T00:14:57.000+0000", "updated": "2016-07-19T00:14:57.000+0000" }, { "id": "391088", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-07-20T14:17:17.000+0000", "updated": "2016-07-22T07:17:55.000+0000" }, { "id": "391158", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "h4. Explanation for KrollObject seemingly 'growing' leak\r\n\r\nIf you observe the video in ticket, you will see the spread graph of KrollObject continuously growing branches, that can look pretty scary. But further investigation proved that it doesn't imply continuous allocation of memory.\r\n\r\nh4. Steps to reproduce\r\n1. You can use the hyperloop-examples, but siong the simple sample code i have in earlier comments can reproduce as well.\r\n2. Configure leaks to take snapshots every 5s\r\n3. Use instruments on device as discussed in earlier comment.\r\n4. Every 5s you will notice branches growing on KrollObject\r\n5. But if you choose allocation, and click 'mark generation'. First time it'll show you the amount of memory allocated since the start of the application. \r\n6. Subsequent clicking of 'mark generation' will show the delta in memory allocation. You will see that it's always '0' implying there's no memory allocation.\r\n\r\n*Note*: Without using hyperloop, on Titanium this will also show as a Root Leak. but same thing applies.", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-07-21T03:16:27.000+0000", "updated": "2016-07-21T03:16:27.000+0000" }, { "id": "391282", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "h4. About *use-jscore-framework*\r\nAs recommended on our hyperloop guide, we should set this property to true when using hyperloop. However, currently this doesn't support our debugger implementation but we'll be working on it very soon!\r\nIf we really want to use debugger on studio, we can set this property to false. Nothing will change functionally, but you will notice that if this is set to false, new leaks will appear on instruments. However, we have verified that these leaks are false negatives. To make sure it's really not leaking:\r\n- In {{Cycles & Roots > Leak Cycles}}, click the right arrow when hovering the mouse-pointer over the leak, and look at the final retain count. it's actually zero, so it's not a leak.\r\n- If it's not zero, look for 2 consecutive callers named {{Initializer}}. In this method, we actually explicitly retain memory, that will be released during garbage collection. So instrument doesn't know it'll be released during garbage collection because we are actually using our legacy Titanium Core (variant of JavascriptCore) that its not familiar with. (Which explains why when {{use-jscore-framework}} is set to true, you won't see any leaks at all because it knows how garbage collection works in their own javascriptcore framework}}.\r\n\r\nSo we can safely assume that as long as there's no leaks when {{use-jscore-framework}} is true, hyperloop module is good. If you do still see leaks, make sure that you have implemented the iOS API correctly (see above URLSession leak), it may not be related to the hyperloop module at all.\r\n\r\nAll in all, PR is ready to be reviewed and merged.\r\nhttps://github.com/appcelerator/hyperloop.next/pull/41\r\nHere is a PR for hyperloop-examples as well.\r\nhttps://github.com/appcelerator/hyperloop-examples/pull/37\r\nIf you are experiencing crashes when using hyperloop, please file tickets with as much descriptions as possible!\r\n\r\n", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-07-22T07:33:22.000+0000", "updated": "2016-07-22T07:35:36.000+0000" }, { "id": "391283", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~sophrinix] Can you do a functional test first?", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-07-22T08:45:06.000+0000", "updated": "2016-07-22T08:45:06.000+0000" }, { "id": "391716", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR approved. [~cng] Please draft a new release on Github, since you should decide if we do the bump or not. Thanks!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-07-27T18:56:27.000+0000", "updated": "2016-07-27T18:56:27.000+0000" }, { "id": "391838", "author": { "name": "sophrinix", "key": "sophrinix", "displayName": "Andrew McElroy", "active": true, "timeZone": "America/Los_Angeles" }, "body": "1.2.5 is substantially better than previous versions. however there are still leaks. \r\nHere is a dropbox url of a tracefile I ran during the hyperloop standup. \r\n\r\nhttps://www.dropbox.com/sh/wozuk5j7scdbcfm/AABKXaTIWiryY8AkXsvdsrp6a?dl=0\r\n\r\n", "updateAuthor": { "name": "sophrinix", "key": "sophrinix", "displayName": "Andrew McElroy", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-07-28T16:33:27.000+0000", "updated": "2016-07-28T16:33:27.000+0000" }, { "id": "391962", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "[~sophrinix] looking at the trace, (ignoring Kroll as explained above), it seems to be only on NSURL related code.\r\nAre you using the latest hyperloop-example? see my comment wrt above:\r\n- leaks appearing from \"HTTP Request\" and only here\r\n-- This is primarily because our example code did not have session.finishTasksAndInvalidate(), required even in ARC to release memory.\r\n-- http://stackoverflow.com/questions/21554987/nsurlsession-memory-leaks-occur-when-using-web-services-in-ios\r\n\r\nI have already merged a PR that addresses this URLRequest leak.", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-07-29T08:40:46.000+0000", "updated": "2016-07-31T12:37:34.000+0000" }, { "id": "416575", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as fixed, if there are any problems, please file a new ticket.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-31T22:16:38.000+0000", "updated": "2017-03-31T22:16:38.000+0000" } ], "maxResults": 22, "total": 22, "startAt": 0 } } }