{ "id": "174515", "key": "AC-6454", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": null, "resolutiondate": null, "created": "2019-12-06T12:41:21.000+0000", "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "fhaque", "key": "fhaque", "displayName": "Fazlul Haque", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2020-01-04T14:40:10.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "Repeated use of showCamera, taking a photo and selecting [Use Photo] causes app to crash when JScore framework is enabled. On SDK 7.5.1 if I set {noformat}false{noformat} then the memory gets deallocated when camera is closed. However, on SDK 8.0.2 and above disabling JScore seems to make no difference and memory usage climbs until the app crashes.\r\n\r\nUsing a new alloy project I've tested using the following JS to replicate the error.\r\n\r\n{code:title=index.js|borderStyle=solid}\r\nvar button = Ti.UI.createButton({\r\n\ttitle: 'Open Camera',\r\n});\r\n \r\nbutton.addEventListener('click', function() {\r\n\tTi.Media.showCamera({\r\n\t\tsuccess: function (e) { },\r\n\t\tcancel: function (e) { },\r\n\t\terror: function (e) { },\r\n\t\tsaveToPhotoGallery: false,\r\n\t\tmediaTypes: [ Ti.Media.MEDIA_TYPE_PHOTO ]\r\n\t});\r\n});\r\n\r\n$.index.add(button);\r\n$.index.open();\r\n{code}\r\n\r\nI've attached screenshots of the readout in Instruments of memory allocations taking 10 photos.\r\n* 7.5.1 JSCore enabled shows memory leak\r\n* 7.5.1 JSCore disabled shows memory deallocated correctly\r\n* 8.0.2 JSCore disabled shows memory leak (no difference to enabled)", "attachment": [ { "id": "67168", "filename": "7.5.1-jscore-disabled.png", "author": { "name": "engwei", "key": "engwei", "displayName": "engwei", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-12-06T12:39:51.000+0000", "size": 210508, "mimeType": "image/png" }, { "id": "67167", "filename": "7.5.1-jscore-enabled.png", "author": { "name": "engwei", "key": "engwei", "displayName": "engwei", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-12-06T12:39:51.000+0000", "size": 209904, "mimeType": "image/png" }, { "id": "67166", "filename": "8.0.2-jscore-disabled.png", "author": { "name": "engwei", "key": "engwei", "displayName": "engwei", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-12-06T12:39:51.000+0000", "size": 213590, "mimeType": "image/png" } ], "flagged": false, "summary": "Memory leak using camera on iOS", "creator": { "name": "engwei", "key": "engwei", "displayName": "engwei", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "engwei", "key": "engwei", "displayName": "engwei", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "iOS 10.3.4\r\nXcode 10.3\r\nTitanium SDK 7.5.1 / 8.0.2 / 8.3.0", "comment": { "comments": [ { "id": "453312", "author": { "name": "fhaque", "key": "fhaque", "displayName": "Fazlul Haque", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Hello [~engwei], Thanks for reporting this issue. Would you please check this issue on latest version of SDK 8.3.0.GA? As we can see you have reproduced this issue on old SDK versions. Thanks", "updateAuthor": { "name": "fhaque", "key": "fhaque", "displayName": "Fazlul Haque", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2019-12-25T18:24:09.000+0000", "updated": "2019-12-25T18:24:09.000+0000" }, { "id": "453333", "author": { "name": "fhaque", "key": "fhaque", "displayName": "Fazlul Haque", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Hello [~engwei],\r\n\r\nI have tested your code on my end and cannot reproduce the crash. I have taken more than 10 photos randomly but the app is not crashing.\r\n*Test Environment:*\r\nSDK: 8.3.0.GA\r\nAppcelerator Command-Line Interface, version 7.1.2\r\niPhone 6plus (iOS 12.4.4)\r\n\r\nIn this case can you please share some crash logs from your device?\r\n\r\nThanks", "updateAuthor": { "name": "fhaque", "key": "fhaque", "displayName": "Fazlul Haque", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2019-12-29T18:46:53.000+0000", "updated": "2019-12-29T18:46:53.000+0000" }, { "id": "453430", "author": { "name": "engwei", "key": "engwei", "displayName": "engwei", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hello Fazlul,\r\n\r\nYes I have recreated this in 8.3.0.GA. The memory allocations graph is the same as previous versions. \r\n\r\nIn order for me to get the phone to crash I have to take 17 photos on an iPhone 5. However there is no crash log for this.\r\nI found an iPhone 6 to test on - it started with iOS 11.1 and it had exactly the same memory issue. I updated it to 12.3.4 and tried again. This time there was some garbage collection which is an improvement, but the phone still eventually crashed. Again there is no crash log.\r\n\r\nThe real issue here is that the memory allocation builds, and while it may occasionally clear using iOS 12.3.4, eventually it maxes out. When doing this in conjunction with other processes in a larger app, the chances of the app crashing are much higher.\r\n\r\n*Test Environment:*\r\nSDK: 8.3.0.GA\r\nAppcelerator Command-Line Interface, version 7.1.2\r\niPhone 5 (iOS 10.3.4) & iPhone 6 (iOS 11.1 & iOS 12.3.4)\r\n\r\nThanks,\r\n\r\nAdam", "updateAuthor": { "name": "engwei", "key": "engwei", "displayName": "engwei", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-01-04T14:40:10.000+0000", "updated": "2020-01-04T14:40:10.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }