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

Android: Possible memory leak when setting ListSections on a ListView

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Release 7.1.0
    • Component/s: Android
    • Labels:
    • Environment:

      MacOS 10.13.2
      Titanium SDK 6.1.2.GA/7.0.1.GA
      Pixel simulator using Android 7.1.1

    • Sprint:
      2018 Sprint 05 SDK, 2018 Sprint 04 SDK

      Description

      Looking at Android Device Monitor, memory usage appears to balloon on Android when using .setSections() on a ListView, particularly when the ListDataItem array for the ListSections is large and when sections are set multiple times. Memory doesn’t seem to clear even when the ListView is removed and its parent controller proxy is cleared and the controller is destroyed. The attached project demonstrates the issue. Clicking "Open List View" populates the ListView with 5 ListSections, each with 1,000 ListDataItems. Clicking "Repopulate List View" creates a new set of 5 sections and sets those sections on the existing list view. The memory footprint increases significantly with each repopulation and never seems to reset. Clicking "Close List View" destroys the controller holding the ListView, but the memory doesn’t appear to reset in that scenario either. Eventually the application runs out of memory and crashes.

      Additional notes: If I put a single ListSection in the XML for the ListView and use setItems on that single ListSection the memory does appear to reset, so it seems to be related to setSections, however in both scenarios if I close the view and destroy the controller the memory does not reset.

        Attachments

          Activity

            People

            • Assignee:
              ybanev Yordan Banev
              Reporter:
              ryan@mvretail.com Ryan Aston
              Reviewer:
              Gary Mathews
              Tester:
              Lokesh Choudhary
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Source Code