Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-75271

Memory Leak occurs when Loading QMLs via QML Loader

    XMLWordPrintable

Details

    • Linux/X11, QNX

    Description

      LoaderMemLeak App (attached) Background:

      • A simple app that uses QML Loader to switch between two QMLs
      • QML 1 and QML2 both just load a PNG image (Qt Logo 1 for QML1 and Qt Logo 2 for QML2), 10,000 times
      • main.qml has a button on the upper left of the UI, used for switching between the two QML files.

      Steps to Reproduce the issue:

      1. On QNX, run the app.
      2. Also, have a separate terminal for the top commaLoaderMemLeak.zipnd to monitor memory consumption
      3. Press the button once, and wait for the image to show up (Green Qt Logo)
      4. After the image is shown, press the button once again to load the second qml, and wait for the image to show up (Red Qt Logo)
      5. While monitoring the output of the top command, press the button rapidly 40-50 times.
        You will notice that after the entire operation, you will notice that the free memory is significantly less than before performing step 5.

      Other things we tried and their results:

      • Repeating steps 3 and 4 above, w/o performing step 5, does not result in a memory leak.
      • Occurs on target (QNX 7, Qt 5.9.6)
      • Occurs on Ubuntu 18.04.2 LTS, Qt 5.12

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            phtorral Phoebus Torralba
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes