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

The QSGBatchRenderer::Renderer's m_vertexUploadPool and m_indexUploadPool buffers never shrink

    XMLWordPrintable

Details

    • Linux/X11
    • 3ccf37ce966923b6b65499f1116ee1941a1f36f1, 3bf5e8b671e0f7be7f3fa5004aedbb2f9838c56a

    Description

      If QtQuick application dynamically allocates memory for QML objects and then deallocates the same objects with destroy() only part of the memory is returned back to the OS.

      Steps to reproduce.

      1. Please run the attached example. 
      2. Inspect the memory usage of the application process (valgrind --tool=massif --pages-as-heap=yes, pmap -d or top)
      3. Create QML objects by pressing the button in the application
      4. Repeat step 2.)
      5. Delete the QML objects by pressing the button in the application
      6. Repeat step 2.)

      It can be observed that only about 1/3 of the memory that was allocated is returned back to the OS.

      mapped: 753432K writeable/private: 85488K shared: 18652K
      mapped: 1112792K writeable/private: 437268K shared: 52304K
      mapped: 1040892K writeable/private: 365752K shared: 52304K

       

      Attachments

        1. 0001-Workaround-to-shrink-batch-renderer-pool-sizes.patch
          1 kB
        2. heaptrack.TexReader.16348.gz
          3.36 MB
        3. massif.out.1095569
          197 kB
        4. MemCheck.tar.gz
          10 kB
        5. qtbug_93956.zip
          3 kB
        6. Screenshot from 2021-05-21 14-19-18.png
          Screenshot from 2021-05-21 14-19-18.png
          224 kB
        7. TextReader_Licenses.tar.gz
          1.33 MB
        8. TextReader_OnlyQML.tar.gz
          1.37 MB

        Issue Links

          Activity

            People

              janichol Andy Nichols
              tuomas.vaarala Tuomas Vaarala
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: