Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25910] Android: Memory leak when using TextFields in TableView rows

GitHub Issuen/a
TypeBug
PriorityNone
StatusClosed
ResolutionFixed
Resolution Date2018-06-19T13:45:20.000+0000
Affected Version/sn/a
Fix Version/sRelease 7.3.0
ComponentsAndroid
Labelsn/a
ReporterShuo Liang
AssigneeGary Mathews
Created2018-03-28T11:48:07.000+0000
Updated2018-07-09T20:21:10.000+0000

Description

Reproduce steps

1. Run the attached simple Alloy app. (Just an Alloy project that opens a modal window which has a TableView with rows containing Textfields. ) 2. Click the "Open Window" 3. Hit the Android "back" button to dismiss the window with the tableview textfield rows 4. Repeat steps 2 & 3 repeatedly until you start seeing messages such as the following:
[INFO] : zygote64: Background concurrent copying GC freed 302993(13MB) AllocSpace objects, 31(496KB) LOS objects, 44% free, 30MB/54MB, paused 214us total 258.736ms
Attached screenshot for that as well.

Attachments

FileDateSize
index.js2018-03-28T11:49:51.000+0000140
index.xml2018-03-28T11:49:42.000+0000100
ListViewPage.js2018-03-28T11:49:52.000+0000260
ListViewPage.xml2018-03-28T11:49:42.000+000095
MemLeak3.png2018-03-28T11:48:06.000+0000523047

Comments

  1. Shuo Liang 2018-04-06

    Any update?
  2. Ingo Muschenetz 2018-05-23

    [~sliang] What is the customer name here?
  3. Gary Mathews 2018-05-23

    This is not a memory leak, the messages are routine logs from the GC after doing a cleanup. If after running for some time, the customers app crashes with an Out of memory exception, then I would consider that a memory leak or mismanagement of memory.
  4. Shuo Liang 2018-05-24

    [~gmathews] Using the example code and repeat 2&3 steps, the app will crash eventually. It might take 5 -10 mins to repeat those steps. but customer confirmed that app will crash for sure.
  5. Gary Mathews 2018-05-29

    *TEST CASE*
       const root = Ti.UI.createWindow({ backgroundColor: 'gray' }),
             btn = Ti.UI.createButton({ title: 'OPEN TABLE WINDOW' });
       
       btn.addEventListener('click', () => {
           const win = Ti.UI.createWindow({ backgroundColor: 'red' }),
                 tableView = Ti.UI.createTableView();
       
           let rows = [];
       
           for (let i = 0; i < 64; i++) {
           	const row = Ti.UI.createTableViewRow();
           	const textField = Ti.UI.createTextField();
       
           	row.add(textField);
           	rows.push(row);
           }
       
           tableView.data = rows;
       
           win.add(tableView);
           win.open();
       });
       
       root.add(btn);
       root.open();
       
  6. Gary Mathews 2018-05-30

    master: https://github.com/appcelerator/titanium_mobile/pull/10081
  7. Gary Mathews 2018-06-01

    Here's the builds for 7_1_0 https://jenkins.appcelerator.org/blue/organizations/jenkins/titanium-sdk%2Ftitanium_mobile/detail/7_1_0-TIMOB-25910/3/artifacts
  8. Lokesh Choudhary 2018-07-09

    Verified the fix in SDK 7.4.0.v20180709112648 & 7.3.0.v20180703051211. Closing. Studio Ver: 5.1.0.201806291005 OS Ver: 4.2.13 Xcode Ver: 7.0.4 Appc NPM: 1.1.3 Appc CLI: 10.13.5 Daemon Ver: Xcode 9.4.1 Ti CLI Ver: 5.1.1 Alloy Ver: 1.12.0 Node Ver: 8.9.1 NPM Ver: 5.5.1 Java Ver: 1.8.0_131 Devices: ⇨ google Nexus 5 --- Android 6.0.1 ⇨ google Nexus 6P --- Android 8.1.0 Emulator: ⇨ Android 4.1.2

JSON Source