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

Continuous memory growth when the source of Loader 3D{} continues to change

    XMLWordPrintable

Details

    • fc3eeb1a5 (dev), 97204ab73 (6.5), 891c45baa (tqtc/lts-6.2)

    Description

      When the source of Loader 3D{} continues to change m_srbCache continues to grow and there seems to be no mechanism to release it.

      Is this the intended behavior?

      QRhiShaderResourceBindings *QSSGRhiContext::srb(const QSSGRhiShaderResourceBindingList &bindings)
      {
          auto it = m_srbCache.constFind(bindings);
          if (it != m_srbCache.constEnd())
              return *it;
      
          QRhiShaderResourceBindings *srb = m_rhi->newShaderResourceBindings();
          srb->setBindings(bindings.v, bindings.v + bindings.p);
          if (srb->create()) {
              m_srbCache.insert(bindings, srb);
          } else {
              qWarning("Failed to build srb");
              delete srb;
              srb = nullptr;
          }
          return srb;
      } 

       

      below is heaptrack (1.1.80) data when test quick3d_memory_leak_3.tar.gz 

      For more details, please see the attached raw heaptrack data.

       

      Even though we can release the SRB cache by using https://doc.qt.io/qt-5/qquickwindow.html#releaseResources after applying https://codereview.qt-project.org/c/qt/qtquick3d/+/436960

      I don't think it's an appropriate use because it releases all graphic resources.

       

       

      Attachments

        Issue Links

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

          Activity

            People

              stromme Christian
              seokhako Seokha Ko
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes