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

Qt3DRender::QTextureImage::setSource leaks memory with RHI

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • None
    • 6.4.1
    • Qt3D
    • None
    • Windows11 Qt6.4.1 MSVC2019
    • d76e9ae0b07bb4417e0b159d7466bca02119b2b6

    Description

      When build and running the attached simple-qml.zip, the memory usage increases over time.

       

      The main source of memory leaks are instances of QD3D11ShaderResourceBindings, created in the Renderer::setBindingAndShaderResourcesForCommand function.

      https://code.qt.io/cgit/qt/qt3d.git/tree/src/plugins/renderers/rhi/renderer/renderer.cpp?h=6.4.1#n2558

       

      Memory usage is around 200MB when the application starts, but in the first 5 minutes memory usage increased by 250MB and QD3D11ShaderResourceBindings instances increased by 15000. In the next 5 minutes memory usage increased by another 250MB and QD3D11ShaderResourceBindings instances increased by 15000.

       

      There are no memory leaks with OpenGL renderer.

      (with set environment variable QT3D_RENDERER=opengl)

       

      This may be the same issue as QTBUG-106972.

       

      Applying the patch https://codereview.qt-project.org/c/qt/qt3d/+/435831 fixes this memory leak, but this patch fails the tests.

      Attachments

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

        Activity

          People

            seanharmer Sean Harmer
            ayamamoto Atsushi Yamamoto
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes