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.