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

Qt5 Eats Your Memory

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.1.1
    • 5.0.0, 5.1.0
    • Widgets: Itemviews
    • None
    • Windows 7 SP1 (64bit), Windows 8 (64bit), Qt4.8.5 MSVC2010 32bit, Qt5.1.0 MSVC2010 32bit, Qt5.1.0 MinGW 4.8 32bit

    Description

      I've detected a very strange behavior in the memory usage when I switch my program from Qt4.8.5 to Qt5.1.0. To demonstrate this I've uploaded an example program. The bug can be reproduced with Qt5.1.0 for MSVC2010 and MinGW 4.8, I've tested both environments. Furthermore, the bug can be reproduced on Windows 7, Windows 8 and Kubuntu 13.04 (Qt5.0.2), I've tested all three operating systems.

      To make it short, I want to insert rows in a table using Qt's model/view architecture. The table has only one column and the model holds just a QVector<int> to fill each cell with a value.
      Take a look at this plot to see what happens when I increase the row count:

      For the last three row count steps (80, 90 and 100 million) no RAM usage is available for the Qt5.1.0 based program because it crashes with an out-of-memory exception. Please note the last step that is valid for both (70 million rows): While the Qt4 based program needs less than 300MB, the Qt5 based program allocates over 1GByte.

      The QVector<int> data for the model is allocated once by the related QVector constructor in my addData() function, so the algorithm for Qt's Growth-Strategy is probably not the problem.

      This seems to be a regression bug, because Qt4 is not affected.

      Attachments

        1. EatMyMemory.png
          EatMyMemory.png
          22 kB
        2. Qt5EatsMyMemory.zip
          2 kB
        3. Qt5EatsMyMemory2.zip
          2 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            tmartsum Thorbjørn Lund Martsum
            rene René Keimling
            Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes