Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26242] Android: Change in memory behavior

GitHub Issuen/a
TypeBug
PriorityNone
StatusClosed
ResolutionFixed
Resolution Date2018-08-06T19:27:46.000+0000
Affected Version/sRelease 7.3.0
Fix Version/sRelease 7.3.0
ComponentsAndroid
Labelsn/a
ReporterYordan Banev
AssigneeGary Mathews
Created2018-07-27T11:15:23.000+0000
Updated2020-08-31T16:14:21.000+0000

Description

[~jquick], [~gmathews] I noticed a change in the memory management after the recent changes on it that I think deserves some attention. Until 7.2.0.GA the sample app I have attached had this behavior. 1. Open the application. 2. Click "Remove". 3. Force GC through the Android profiler tool. 4. Click "Add again". The colorized views are successfully added again to the window. After the merge of: https://github.com/appcelerator/titanium_mobile/pull/10174 the same sequence results in a crash (attached in the ticket). That happens because the Views are garbage collected. The same goes with Ti.Map module when AnnotaionProxies are released (that happens when they are removed from the MapView) for example. What bothers me is that this change may cause problems in applications that are relying on keeping the references to proxies in the same context after heavy memory usage (one that can cause the system to garbage collect). And I think if that is the case for Proxies in general we may have that problem in a variety of usages. How do you think we should go about that? Note: I haven't matched the position of the views to be related to the device's screen. I have been testing on Pixel emulator. P.S. We talked with Joshua about that earlier this week and at that moment we had a upcoming changes in the most recent PR for memory management. I have tested today with it and the described change in behavior is still present.

Attachments

FileDateSize
app.js2018-07-27T11:09:21.000+00001645
consoleLog.txt2018-07-27T11:09:21.000+00003913
lifecycle.svg2018-08-01T19:36:20.000+000014619

Comments

  1. Gary Mathews 2018-08-01

    master: https://github.com/appcelerator/titanium_mobile/pull/10221 7_3_X: https://github.com/appcelerator/titanium_mobile/pull/10224
  2. Lokesh Choudhary 2018-08-08

    Verified the fix in SDK 7.3.0.v20180807095741 & 7.4.0.v20180807122127. Closing.

JSON Source