Scrolling of Listview causing huge memory consumption in Qt 5.0
-
Please show us your code.
Are you talking about QML ListView or a QtWidget? How do you create the model and delegates?
-
Hi, bit more code and information to be of service to you. What Qt version, and like slerdzio says, some code
-
So we cannot really help you.
ListView instantiates the delegate objects as needed (new entry is generated when it is coming into view), perhaps you are not managing it's memory well enough. As a general advice, experiment with "clip" property.
-
@import QtQuick 2.0
Rectangle {
id : viewer
width: 800
height: 480
function addItem()
{
picSrcList.append({"src":"file:///C://Images//background.png"});
picSrcList.append({"src":"file:///C://Images//folder.png"});
picSrcList.append({"src":"file:///C://Images//tick.png"});} ListModel { id : picSrcList } Component { id : picDelegate Image { source: src fillMode: Image.PreserveAspectFit asynchronous: true width: viewer.width height: viewer.height } } ListView { id :picListView anchors.fill: parent delegate: picDelegate model : picSrcList orientation : ListView.Horizontal snapMode: ListView.SnapOneItem } Component.onCompleted: { addItem() }}
@
This is an example code in which similar issue is seen. The memory consumption increases when we flick the list view. -
I don't see anything amiss here. Maybe you need to turn of Image caching, or periodically run the garbage collector.