Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
None
-
5.0.2, 5.1.0
-
None
-
Windows 7 64bit, Visual Studio 2010 SP1, Qt5.1.0 beta1 for msvc2010 32bit
Description
I've uploaded a QtCreator project to reproduce the issue.
Test-Setup:
- Microsoft Windows 7 64bit, Windows 8 64bit
- Qt5 MSVC2010 32bit (tested with Qt5.0.2, Qt5.1.0)
- a table model and a table view
- the model tries to insert a huge amount of items (>40 million items)
Steps to reproduce:
- Start application
Result:
- QHeaderView tries to insert 45 million sectionItems in its internal vector, but the QVector<T>::reallocData() function crashes, because the QVector-internal Data::allocate() function causes an out of memory exception.
- Here comes an overview about the max. possible rows that can be inserted on different OS and Qt versions, which I was able to test:
Windows 7 64bit Windows 8 64bit Linux 32/64bit Qt5.x.y 44.739.241 89.478.483 119.304.647 Qt4.8.4 119.304.647 119.304.647 119.304.647 The max. rowCount of 119.304.647 is OK, because this is the result of MAX_SIGNED_INT / myRowHeight (0x7FFFFFFF / 18), see QTBUG-18490 for more details.
- This seems to be a regression bug, because Qt4 is not affected.
- Although Qt is platform independent, three different results on three different operating systems can be found.
Background:
We are using a large amount of data (up to 100 million items), our table model uses a sqlite database as backend, so in fact only a few items (of our internal prefetch buffer) are in memory, all the rest is on hard disk. The prefetch buffer reduces the SQL access when scrolling the view through all the data. Additionally, we have a lot of filters and search functions to manage such an amount of data easily. Everything works very fine and fast with Qt4, but crashes with Qt5 as described.