{ "id": "174915", "key": "TIMOB-27851", "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": "21018", "name": "Release 9.0.2", "archived": false, "released": true, "releaseDate": "2020-05-19" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2020-05-05T21:09:58.000+0000", "created": "2020-04-16T11:40:50.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [], "versions": [ { "id": "20033", "name": "Release 9.0.0", "archived": false, "released": true, "releaseDate": "2020-03-18" } ], "issuelinks": [], "assignee": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2020-05-05T21:09:59.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": "h2. Description\r\nHTTPClient is leaking memory causing an eventual crash, appears to have only been introduced in 9.0.0.GA, could be regression on this issue: TIMOB-26811\r\n\r\nh2. How to reproduce\r\nThis sample will fire 20 url fetches every 1 second, it clearly shows the memory leak in xcode instruments. Do not run for long too long...\r\n\r\nIndex.js\r\n{code:java}\r\nvar triggerLoop = function() {\r\n _.times(20, fetchUrl);\r\n};\r\n\r\nfunction fetchUrl() {\r\n var client = Ti.Network.createHTTPClient({\r\n onload: function(e) {\r\n client = null;\r\n },\r\n onerror: function(e) {\r\n client = null;\r\n },\r\n timeout: 1000\r\n });\r\n client.open(\r\n \"GET\",\r\n \"https://example.com/\"\r\n );\r\n client.send();\r\n console.log(\"Fetching Url\");\r\n}\r\n\r\nsetInterval(triggerLoop,1000);\r\n{code}\r\n\r\nIf you monitor with xcode leaks profiler, you will see a large amount of leaks from CFNetwork, I have attached the screenshots of profiling tool results.\r\n\r\n\r\n", "attachment": [ { "id": "67337", "filename": "Screenshot 2020-04-16 at 12.19.54.png", "author": { "name": "jfinnigan", "key": "jfinnigan", "displayName": "Joe Finnigan", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-04-16T11:38:44.000+0000", "size": 57597, "mimeType": "image/png" }, { "id": "67336", "filename": "Screenshot 2020-04-16 at 12.20.01.png", "author": { "name": "jfinnigan", "key": "jfinnigan", "displayName": "Joe Finnigan", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-04-16T11:38:45.000+0000", "size": 316150, "mimeType": "image/png" } ], "flagged": false, "summary": "iOS: Ti.Network.createHTTPClient memory leak", "creator": { "name": "jfinnigan", "key": "jfinnigan", "displayName": "Joe Finnigan", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jfinnigan", "key": "jfinnigan", "displayName": "Joe Finnigan", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "TiSDK: 9.0.0.GA\r\nXcode: 11.3.1\r\niOS: 13.3.1\r\nDevice: iPad ", "closedSprints": [ { "id": 1194, "state": "closed", "name": "2020 Sprint 9", "startDate": "2020-04-24T17:09:51.572Z", "endDate": "2020-05-08T17:09:00.000Z", "completeDate": "2020-05-08T15:40:07.869Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "455164", "author": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I could reproduce the leak as mentioned in the details using the test code provided.\r\nHowever the issue doesn't seems to be a regression in 9.0.0.GA. Using the same test app similar leaks at a similar rate were observed in older SDK builds as well. Tried with titanium SDK build 9.0.0.GA, 8.3.1.GA, 8.3.0.GA and 8.0.0.GA\r\n\r\nVerified on:\r\nMac OS: 10.15.4\r\nAppc CLI: 8.0.0, 7.1.2\r\nNode: 10.16.3\r\nStudio: 6.0.0.202003181504\r\nXcode: 11.4, 11.2.1\r\niOS Device: iPhone 7(v12.4.5)", "updateAuthor": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-04-16T22:58:33.000+0000", "updated": "2020-04-16T22:58:33.000+0000" }, { "id": "455165", "author": { "name": "jfinnigan", "key": "jfinnigan", "displayName": "Joe Finnigan", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The app that I discovered this in was previously using Ti SDK 8.0.1.v20190326110553 and didn't exhibit the leak, granted not running this exact test code but its very close.", "updateAuthor": { "name": "jfinnigan", "key": "jfinnigan", "displayName": "Joe Finnigan", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-04-17T00:11:56.000+0000", "updated": "2020-04-17T00:11:56.000+0000" }, { "id": "455193", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (master) - https://github.com/appcelerator/titanium_mobile/pull/11649\r\nPR (9_0_X) - https://github.com/appcelerator/titanium_mobile/pull/11650\r\nPR (app_sdk) - https://github.com/appcelerator/aps_sdk/pull/343", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-04-20T21:12:24.000+0000", "updated": "2020-04-20T21:22:12.000+0000" }, { "id": "455233", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Can you please provide a bit of insight on which version caused the regression? It's important for knowing if we're affected or not. Thank you!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2020-04-24T21:28:22.000+0000", "updated": "2020-04-24T21:28:22.000+0000" }, { "id": "455266", "author": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~hknoechel] I tried as far back as 7.5.0.GA and could reproduce the leaks related to CFNetwork on 7.5.0.GA as well using the test code in the ticket. Hope this helps.", "updateAuthor": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-04-28T01:07:15.000+0000", "updated": "2020-04-28T01:07:15.000+0000" }, { "id": "455272", "author": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed", "updateAuthor": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-04-28T03:48:19.000+0000", "updated": "2020-04-28T03:48:19.000+0000" }, { "id": "455372", "author": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "body": "No CFNetwork leaks seen.\r\n\r\nVerified on:\r\nMac OS: 10.15.4\r\nSDK: 9.1.0.v20200505112143, 9.0.2.v20200505111803\r\nAppc CLI: 8.0.0\r\nNode: 10.16.3\r\nStudio: 6.0.0.202003181504\r\nXcode: 11.4\r\niOS Device: iPhone 7(v12.4.5), iPhone X(v13.4), iOS simulator 13.4", "updateAuthor": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-05-05T21:09:58.000+0000", "updated": "2020-05-05T21:09:58.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }