Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
5.12.7, 5.15
Description
I encountered a bug when a customer had a UI running for a long time, the application ran out of memory.
I condensed the whole setup in a trival example to reproduce the issue.
It consists of a subclassed QAbstractItemModel that holds actually no data but just the count of items. Also, there can only be a maximum number of items (25 by default) in the list. The Model should behave like deque, when a new item is appended and the max number of items was reached, the first item is removed. I use begin/endInsertRows and begin/endRemoveRows only. The model is attached to Repeater with an empty Item as delegate.
When clicking the button in the example, each time, 100 items are added to the list.
The button caption shows the item count in the list, which is capped at 25.
However, when you click the button several times you can observe an increase of used memory in the task manager.
I also did a heaptrace with Visual Studio it seems to me that there dangling QQuickItems in memory and the issue gets worse the more complex the delegates are.