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

Potential memory leak in sending queued signals?

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • P1: Critical
    • Resolution: Done
    • 6.1.0
    • 6.0.4, 6.1.0, 6.1, 6.2
    • Core: Event loop
    • None
    • Linux/X11

    Description

      With the introduction of Qt 6 we encountered a memory leak which seems to be caused by sending queued signals.

      I attached an example project along with a  heaptrack summary that points to some QByteArray reallocation when queued_activate for a signal is called.

      The sample project is quite simple: A producer generates some signals in a thread. These signals are connected as Qt::QueuedConnections to a slot of an object in the main thread.

      If I do something wrong in connection the thread please let me know

      Btw, I made the same test with Qt 5.15 and the memory usage was stable.

      Attachments

        1. heaptrack.test-memoryusage.3934226.zst
          63 kB
          Marc Langenbach
        2. memoryusage.zip
          2 kB
          Marc Langenbach

        Issue Links

          For Gerrit Dashboard: QTBUG-91801
          # Subject Branch Project Status CR V

          Activity

            People

              agolubev Andrei Golubev
              mlangen Marc Langenbach
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There is 1 open Gerrit change