Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26967] iOS: Memory leak in Ti.API.debug

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2019-05-15T22:02:32.000+0000
Affected Version/sRelease 8.0.0
Fix Version/sRelease 8.0.1
ComponentsCore, iOS
Labelsn/a
ReporterLuke Lu
AssigneeChristopher Williams
Created2019-04-02T03:27:13.000+0000
Updated2019-05-15T22:02:32.000+0000

Description

Attachments

FileDateSize
iPhoneXs.png2019-04-05T02:41:54.000+000031416
New Project.png2019-04-05T02:34:46.000+000049699
New Project (1).png2019-04-05T02:43:52.000+0000172792
Xcode10.1_v8.0.1v20190401125424.png2019-04-03T02:27:33.000+0000100264
xcode9_8.1.0.v20190328075104.png2019-04-02T03:27:03.000+0000145175
xcode9_v6.3.0.GA.png2019-04-02T03:27:03.000+0000149134
xcode9_v8.0.1.v20190401125424.png2019-04-02T03:27:03.000+0000143783

Comments

  1. Sharif AbuDarda 2019-04-03

    Hello, Can you share a sample app that reproduces the issue? Please share steps to reproduce also. Thanks.
  2. Luke Lu 2019-04-03

    i have updated the description with more details, thanks
  3. Rakhi Mitro 2019-04-04

    [~luke_lu], Did you manage to test on SDK Release 8.0.1?
  4. Luke Lu 2019-04-05

    Yes Rakhi Mitro, we tested on 8.0.1 as well with the same result.
  5. Luke Lu 2019-04-05

    So, we again tested the app without API call, this time, we open the photo gallery and select an image and test on various devices/SDK version. We still can see the memory leak issue. Versions: _{color:#707070}Operating System Name = Mac OS X Version = 10.14.3 Architecture = 64bit # CPUs = 4 Memory = 17179869184 Node.js Node.js Version = 8.0.0 npm Version = 5.0.0 Titanium CLI CLI Version = 5.1.1 Titanium SDK SDK Version = 8.1.0.v20190328075104 SDK Path = /Users/suchanbadyakar/Library/Application Support/Titanium/mobilesdk/osx/8.1.0.v20190328075104 Target Platform = iphone{color}_ Memory profile for iphone 6s plus (12.2) !New Project.png|thumbnail! Code: function openGalleryClick(e) { Titanium.Media.openPhotoGallery({ }); }
  6. Luke Lu 2019-04-05

    Memory profile for iPhone Xs(12.2) !iPhoneXs.png|thumbnail! for the first click, it seems to release memory but afterwards same. App view !New Project (1).png|thumbnail! So, basically memory profile looks perfect for 6.X.X but breaks after 7.X.X for - API call - Photo Gallery
  7. Luke Lu 2019-04-05

    We were able to replicate the same issue in the KitchenSink-v2 as well https://github.com/appcelerator/kitchensink-v2
  8. Jan Vennemann 2019-04-08

    [~luke_lu], if you compare between 6.3.0 and 8.0.0 please make sure to have <use-jscore-framework>true</use-jscore-framework> set. Otherwise you will be comparing the memory management of two different JS engines. Now, I couldn't see any leaks related to network requests anymore. However, the memory allocation indeed keeps growing when running you example. After some investigation i found out that the Ti.API.debug(this.responseText); statement is responsible for allocating a huge amount of memory and leaking it. In this case this is due to printing the response text. If you remove that statement you will also see the memory being released after some time (around 20 request and 2-3 minutes wait). Moving this to TIMOB for further investigation to leaks related to Ti.API.debug.
  9. Wayn Wong 2019-04-09

    Hi @jan, thanks for the update.
  10. Jan Vennemann 2019-05-02

    [~cwilliams], this appears to be the issue. I assumed there was some kind of leak but i did another check and it is indeed the log message queue that is responsible for the growing allocation one can see in instruments. [~amukherjee], this is an additional important fix we should take into 8.0.2!
  11. Luke Lu 2019-05-10

    So, it is getting better. we were able to get performance optimization when tried 8.1.X. But our app got rejected from the app store for the following reason: #1: "*Your app crashed on iPad running iOS 12.2 on WiFi when we:* - Log in using the provided credentials - Afterwards, the app crashes on launch We have attached detailed crash logs to help troubleshoot this issue." Attached within the crash log they sent. *# 2: On investigation, we are getting this error that may be the cause of the issue* [ERROR] Could not load _index_.json require index, error was File not found [ERROR] Script Error: Couldn't find module: ./app for architecture: arm64 Any idea how we can fix this, without this we cannot proceed forward in the app store.
  12. Lokesh Choudhary 2019-05-13

    8_0_X : https://github.com/appcelerator/titanium_mobile/pull/10886
  13. Samir Mohammed 2019-05-14

    *FR Passed*, waiting on Jenkins build. [~cwilliams] [~jvennemann] were you able to take a quick look at the comment above?
  14. Christopher Williams 2019-05-14

    merged to master/8_0_X.
  15. Christopher Williams 2019-05-14

    As for the "missing" _index_.json file, that is something the CLI build writes into the app. If you're trying to take the Xcode project from the app build and then run that under Xcode, it's likely that file won't exist (and is not a workflow we support). Are you seeing that using a normal SDK CLI/Studio build, or does that only happen when trying to build via Xcode?
  16. Luke Lu 2019-05-15

    8.0.X fixed the crashing issue. Thank you so much, that saved my day. Regarding "missing index.json", Yes I tried to build from Xcode. I was able to build from Xcode for titanium SDK 7.4.1 but not after 8.X.X. But yeah thats not that important as we do build from the cli and was using Xcode to debug.
  17. Lokesh Choudhary 2019-05-15

    Verified the fix in SDK 8.0.1.v20190514113328. Closing. Studio Ver: 5.1.2.201903111843 SDK Ver: 8.0.1.v20190514113328 OS Ver: 10.14 Xcode Ver: Xcode 10.1 Appc NPM: 4.2.13 Appc CLI: 7.0.11 Daemon Ver: 1.1.3 Ti CLI Ver: 5.1.1 Alloy Ver: 1.13.9 Node Ver: 8.15.1 NPM Ver: 6.4.1 Java Ver: 10.0.2 IOS Device: Iphone 10 IOS 12

JSON Source