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

Memory Leak when using QQuickPaintedItem with RHI

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 6.1.3, 6.2.0 Beta3, 6.3.0 Alpha
    • 5.15.2, 6.2.0 Beta1
    • Qt RHI
    • None
    • Windows
    • 146f8cbf865e0061859dd9f1c7a477db91298052 (qt/qtdeclarative/dev) 2663608da0a3949d3cfb497372cc1b81b0603336 (qt/qtdeclarative/6.2) d7f2ecbc67337f67d497e01271c919766f202614 (qt/qtdeclarative/6.1)

    Description

      Our application uses QQuickPaintedItem to draw custom elements in QML.

      eg a decorated line in the attached example.

       

      With Qt 5.15.2 and Qt 6.2.0 beta we detected a rather large memory leak depending on the

      used graphics API.

      Qt 5.15.2

      OpenGL: no leak

      Angle_D3D11: no leak
      OpenGLRhi: memory leak
      Direct3D11Rhi: memory leak

       

      Qt 6.2.0 (current beta)

      OpenGL: memory leak

      Angle_D3D11: memory leak
      OpenGLRhi: memory leak
      Direct3D11Rhi: memory leak

       

      On 6.2.0 all backends seem to "eat" memory" even NullRhi.

       

      A minimum example reproducing the issue is found here:
      https://github.com/glaure/qt_rhi_qquickpainteditem_leak

       

      The example is just painting "QLineItems" using a repeater.

      (It seems to be important to paint more than one item)

       

      The attached memory screenshots use Qt 5.15.2

      Attachments

        1. OpenGL (Release Build) - no leak.png
          13 kB
          Gunther Laure
        2. OpenGL RHI (Debug Build).png
          13 kB
          Gunther Laure
        3. OpenGL RHI (Release Build).png
          13 kB
          Gunther Laure
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            lagocs Laszlo Agocs
            glaure Gunther Laure
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes