Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-7399

Android: TableView: Scrolling through a Table View with image causes application to run out of memory and hang

    Details

      Description

      Problem

      When you scroll through a table view with image, memory runs low and application eventually hangs.

      Sample Code

      Consider the following code, and download the attached iproducts.png to your resources directory:

      app.js

      var win = Ti.UI.createWindow({ backgroundColor: '#fff' });
       
      var rows = [];
      for (var i = 0; i < 200; i++) {
          var row = Ti.UI.createTableViewRow();
          row.add(Ti.UI.createLabel({ text: 'Row ' + i, left: 70 }));
          row.add(Ti.UI.createImageView({ image: 'iproducts.png', left: 10 }));
          rows.push(row);
          row = null;
      }
      win.add(Ti.UI.createTableView({
          data: rows,
          bottom: 50
      }));
       
      var freeMemory = Ti.UI.createLabel({
          height: 50, bottom: 0
      });
      setInterval(function() {
          freeMemory.text = 'Free Memory: ' + Ti.Platform.availableMemory;
      }, 1000);
      win.add(freeMemory);
       
      win.open({
          modal: true,
          modalStyle: Ti.UI.iPhone.MODAL_PRESENTATION_FORMSHEET
      });
      

      Steps To Reproduce

      1. Drop the above in an app.js
      2. Download the attached iproducts.png to your Resources directory
      3. Run the app on device
      4. Slowly scroll through the whole table, making sure all of the rows are loaded.

      Actual Result:
      Application hangs by row 7

      Expected Result:
      To load the table without hanging

      Note: Also occur in 1.8.0.1

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                joshroesslein Josh Roesslein
                Reporter:
                nhuynh Natalie Huynh
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-11897
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Integration