{ "id": "172940", "key": "TIMOB-26811", "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": "20432", "name": "Release 8.0.1", "archived": false, "released": true, "releaseDate": "2019-05-15" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2019-04-25T10:31:22.000+0000", "created": "2019-01-31T03:34:16.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [], "versions": [ { "id": "20238", "description": "", "name": "Release 7.5.0", "archived": false, "released": true, "releaseDate": "2018-11-15" } ], "issuelinks": [], "assignee": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2019-04-25T10:31:22.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\nAfter upgrade sdk version from 6.3.0 to 7.4.1/7.5.0, IOS start to have a big memory leak issue when making api requests. The app is going to crash when memory are too high. \r\n\r\nh2. How to reproduce \r\nI have create a simple app with only one api request which will be called every 10 seconds, you can build the app from https://github.com/lukeluluke/simpleApp.git\r\n1. Clone the project and build with sdk v7.5.0.GA\r\n2. Use Instruments to monitor the memory usage and leaks\r\n3. You will find the memory keep increasing , and the are memory leaks for almost each api request. \r\n4. Rebuild the app with sdk v.6.3.0.GA.\r\n5. Use Instruments to monitor the memory usage and leaks\r\n6. You will see the is only one leak in the beginning\r\n\r\nI have attached the screenshots of profiling tool\r\n\r\nh2. Update\r\nI have upgraded xcode to latest version, and removed the setInterval function, memory leaks still exist when trigger api calls manually. Please see screenshots below. ", "attachment": [ { "id": "66117", "filename": "v6.3.0.GA.png", "author": { "name": "luke_lu", "key": "luke_lu", "displayName": "Luke Lu", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-01-31T03:34:09.000+0000", "size": 468078, "mimeType": "image/png" }, { "id": "66116", "filename": "v7.5.0.GA_memory_leak.png", "author": { "name": "luke_lu", "key": "luke_lu", "displayName": "Luke Lu", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-01-31T03:34:09.000+0000", "size": 658861, "mimeType": "image/png" }, { "id": "66122", "filename": "v7.5.0.GA_xcode_10_production_app.png", "author": { "name": "luke_lu", "key": "luke_lu", "displayName": "Luke Lu", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-02-01T00:28:54.000+0000", "size": 403039, "mimeType": "image/png" }, { "id": "66123", "filename": "v7.5.0.GA.xcode_10_simpleApp_remove_setInterval.png", "author": { "name": "luke_lu", "key": "luke_lu", "displayName": "Luke Lu", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-02-01T00:29:32.000+0000", "size": 433169, "mimeType": "image/png" }, { "id": "66137", "filename": "v8.0.0.v20190123061938_memory_leak.png", "author": { "name": "luke_lu", "key": "luke_lu", "displayName": "Luke Lu", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-02-07T02:47:31.000+0000", "size": 667702, "mimeType": "image/png" } ], "flagged": false, "summary": "iOS: Memory leak in Ti.Network.HTTPClient", "creator": { "name": "luke_lu", "key": "luke_lu", "displayName": "Luke Lu", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "luke_lu", "key": "luke_lu", "displayName": "Luke Lu", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "ios v11.4\r\ntitanium sdk v7.5.0.GA", "comment": { "comments": [ { "id": "445781", "author": { "name": "luke_lu", "key": "luke_lu", "displayName": "Luke Lu", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I know this is not the correct project to report, but this is the only project I can select when creating the issue", "updateAuthor": { "name": "luke_lu", "key": "luke_lu", "displayName": "Luke Lu", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-01-31T03:48:09.000+0000", "updated": "2019-01-31T03:48:09.000+0000" }, { "id": "445785", "author": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "body": "[~luke_lu],\r\nThanks for reporting this. Can you please try using the upper Xcode version 10/10.1 and let us know the results.", "updateAuthor": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2019-01-31T09:16:27.000+0000", "updated": "2019-01-31T09:16:27.000+0000" }, { "id": "445786", "author": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~luke_lu], you are using {{setInterval}} to make the request. There is a known leak in 7.5.0.GA related to timers that was fixed in TIMOB-26688. This fix is included in the upcoming 7.5.1.GA release. You can already check it out via {{ti sdk install -b 7_5_X}}.", "updateAuthor": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "created": "2019-01-31T13:43:49.000+0000", "updated": "2019-02-06T10:57:18.000+0000" }, { "id": "445794", "author": { "name": "luke_lu", "key": "luke_lu", "displayName": "Luke Lu", "active": true, "timeZone": "America/Los_Angeles" }, "body": "For our production app, it has memory leaks and crash a lot since upgraded sdk from v6.3.0.GA to v7.4.1.GA. When we profiling the memory usage, we found memory will increase for each api request, that is why I use setInterval function to simulate multiple api requests. ", "updateAuthor": { "name": "luke_lu", "key": "luke_lu", "displayName": "Luke Lu", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-01-31T22:07:09.000+0000", "updated": "2019-01-31T22:07:09.000+0000" }, { "id": "445811", "author": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "body": "[~luke_lu],\r\nDid you manage to check using ti sdk install -b 7_5_X?", "updateAuthor": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2019-02-03T09:01:06.000+0000", "updated": "2019-02-03T09:01:06.000+0000" }, { "id": "445863", "author": { "name": "luke_lu", "key": "luke_lu", "displayName": "Luke Lu", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I have tried 7_5_X and 8_0_X, memory leaks still exist. I have updated the test app's git repository, you can test the newest code. Thanks", "updateAuthor": { "name": "luke_lu", "key": "luke_lu", "displayName": "Luke Lu", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-02-05T23:57:10.000+0000", "updated": "2019-02-05T23:57:20.000+0000" }, { "id": "445872", "author": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Hello,\r\n\r\nOur engineering team verified the fix on SDK 8.0.0.v20190123061938 in branch 8_0_X. Can you try using the following version and let us know the results.\r\n\r\n*appc ti sdk install 8.0.0.v20190123061938*.", "updateAuthor": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2019-02-06T10:33:37.000+0000", "updated": "2019-02-06T10:33:37.000+0000" }, { "id": "445900", "author": { "name": "luke_lu", "key": "luke_lu", "displayName": "Luke Lu", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi Rakhi, \r\n\r\ni have installed 8.0.0.v20190123061938, but it doesn't help. I can still see the memory leaks by using Instruments. Please see attached screenshot. Can you please review the code of sample app (only a fews lines), are there something we need to do after make api calls.\r\n\r\nThanks\r\n !v8.0.0.v20190123061938_memory_leak.png|thumbnail! \r\n \r\n\r\n", "updateAuthor": { "name": "luke_lu", "key": "luke_lu", "displayName": "Luke Lu", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-02-07T02:49:18.000+0000", "updated": "2019-02-07T02:49:18.000+0000" }, { "id": "445902", "author": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~luke_lu], these look different then those from your previous example. I'll take a look!", "updateAuthor": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "created": "2019-02-07T10:53:45.000+0000", "updated": "2019-02-07T10:53:45.000+0000" }, { "id": "445935", "author": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "body": "Alright, after some comparison between 6.3 and 7.X it seems like we indeed leak some memory in our HTTP client. Moving this to TIMOB for further investigation.", "updateAuthor": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "created": "2019-02-08T15:52:02.000+0000", "updated": "2019-02-08T15:52:02.000+0000" }, { "id": "445939", "author": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR: https://github.com/appcelerator/APSHTTPClient/pull/48", "updateAuthor": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "created": "2019-02-08T16:37:01.000+0000", "updated": "2019-02-08T16:37:01.000+0000" }, { "id": "446133", "author": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "body": "PRs to update the APSHTTPClient library in the SDK:\r\n\r\nPR (master): https://github.com/appcelerator/titanium_mobile/pull/10704\r\nPR (8_0_X): https://github.com/appcelerator/titanium_mobile/pull/10705", "updateAuthor": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "created": "2019-02-18T10:50:11.000+0000", "updated": "2019-02-18T10:50:11.000+0000" }, { "id": "446722", "author": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR (aps_sdk): https://github.com/appcelerator/aps_sdk/pull/332", "updateAuthor": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "created": "2019-03-11T16:00:33.000+0000", "updated": "2019-03-11T16:00:33.000+0000" }, { "id": "446973", "author": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~ssekhri], add the following below [this line|https://github.com/lukeluluke/simpleApp/blob/e6c265c2dc0b7073a3da50feabb0ec2f616b4d6b/SimpleProject2/app/controllers/index.js#L22v] to force the HTTP client to get cleared immediately.\r\n\r\n{code}\r\nxhr = null;\r\n{code}\r\n\r\nOtherwise it might take a while until the JS GC kicks in and actually deletes the client and all of its resources (including the leaking objects). You should now no longer see any leaks related to networking.", "updateAuthor": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "created": "2019-03-19T15:21:50.000+0000", "updated": "2019-03-19T15:21:50.000+0000" }, { "id": "446984", "author": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "body": "Ok, there still seems to be an issue with leaking objects. I tried with a forced garbage collection and in fact the leaks now only show after a GC. Giving this another pass tomorrow.", "updateAuthor": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "created": "2019-03-19T19:42:32.000+0000", "updated": "2019-03-19T19:42:32.000+0000" }, { "id": "447135", "author": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed. Merged to master and 8_0_X", "updateAuthor": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-03-25T22:08:59.000+0000", "updated": "2019-03-25T22:08:59.000+0000" }, { "id": "447434", "author": { "name": "luke_lu", "key": "luke_lu", "displayName": "Luke Lu", "active": true, "timeZone": "America/Los_Angeles" }, "updateAuthor": { "name": "luke_lu", "key": "luke_lu", "displayName": "Luke Lu", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-04-03T00:27:48.000+0000", "updated": "2019-04-03T00:27:48.000+0000" }, { "id": "447942", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-04-25T10:31:18.000+0000", "updated": "2019-04-25T10:31:18.000+0000" } ], "maxResults": 19, "total": 19, "startAt": 0 } } }