[TIMOB-26967] iOS: Memory leak in Ti.API.debug
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2019-05-15T22:02:32.000+0000 |
Affected Version/s | Release 8.0.0 |
Fix Version/s | Release 8.0.1 |
Components | Core, iOS |
Labels | n/a |
Reporter | Luke Lu |
Assignee | Christopher Williams |
Created | 2019-04-02T03:27:13.000+0000 |
Updated | 2019-05-15T22:02:32.000+0000 |
Description
Attachments
File | Date | Size |
---|---|---|
iPhoneXs.png | 2019-04-05T02:41:54.000+0000 | 31416 |
New Project.png | 2019-04-05T02:34:46.000+0000 | 49699 |
New Project (1).png | 2019-04-05T02:43:52.000+0000 | 172792 |
Xcode10.1_v8.0.1v20190401125424.png | 2019-04-03T02:27:33.000+0000 | 100264 |
xcode9_8.1.0.v20190328075104.png | 2019-04-02T03:27:03.000+0000 | 145175 |
xcode9_v6.3.0.GA.png | 2019-04-02T03:27:03.000+0000 | 149134 |
xcode9_v8.0.1.v20190401125424.png | 2019-04-02T03:27:03.000+0000 | 143783 |
Hello, Can you share a sample app that reproduces the issue? Please share steps to reproduce also. Thanks.
i have updated the description with more details, thanks
[~luke_lu], Did you manage to test on SDK Release 8.0.1?
Yes Rakhi Mitro, we tested on 8.0.1 as well with the same result.
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({ }); }
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
We were able to replicate the same issue in the KitchenSink-v2 as well https://github.com/appcelerator/kitchensink-v2
[~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 theTi.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 toTi.API.debug
.Hi @jan, thanks for the update.
[~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!
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.
8_0_X : https://github.com/appcelerator/titanium_mobile/pull/10886
*FR Passed*, waiting on Jenkins build. [~cwilliams] [~jvennemann] were you able to take a quick look at the comment above?
merged to master/8_0_X.
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?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.
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