Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.6.2
-
Linux, x86_64 & ARM
-
1e0685136d0debb2a3b62d9f4650c95afe41913b (5.9.1) bd5345637453697269bb20bd8d25128432ea8265 (5.6.3)
Description
Each QML warning that is produced e.g. when loading a component or in JavaScript seems to be stored forever in some internal list and is never released.
Run qmlscene Test.qml:
Test.qml
import QtQuick 2.5 Rectangle { id: root color: "gray" width: 600 height: 400 MouseArea { anchors.fill: parent onClicked: { ldr.current = 0; tmr.restart(); } Loader { id: ldr anchors.right: parent.right anchors.bottom: parent.bottom property int current: 0 onLoaded: { current++; if (current < 100000) { tmr.restart(); } } } Timer { id: tmr repeat: false running: false interval: 0 onTriggered: { ldr.setSource("Warning.qml", { text: ldr.current }); } } } }
that loads Warning.qml:
import QtQuick 2.5 Rectangle { id: root property alias text: txt.text property var xx: null color: "white" width: 80 height: 40 Text { id: txt anchors.centerIn: parent } Component.onCompleted: { if (root.xx.y === 0) { console.log("asdd"); } } }
And watch the memory grow. On my machine, the memory consumption grows by about 500 byte/load.
This issue leads to fast memory growth when a component is repeatedly loaded as a list delegate or an external event triggers a similar warning.