import QtQuick 2.0 Rectangle { id: main property var dyn : [] width: 360 height: 360 Rectangle{ color: "gray" anchors.top: parent.top anchors.left: parent.left width : 100 height : 100 Text { anchors.centerIn: parent text: "create" } MouseArea { anchors.fill: parent onClicked: { for (var a=0;a<5000;a=a+1) { var newObject = Qt.createQmlObject('import QtQuick 2.0; Item { \ Rectangle { anchors.centerIn: parent; color: "blue"; width: 50; height: 50} }', main, "foo"); // Large array variable that can be inserted to QML to demonstrate that the accumulation is propotional, least partially, to code size. // property var biggie: [100,100,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500];\ if (newObject.qmlerrors) { console.log(newObject.qmlerrors.message); break; } else dyn.push(newObject); } console.log("pushed 5000"); } } } Rectangle{ color: "gray" anchors.top: parent.top anchors.right: parent.right width : 100 height : 100 Text { anchors.centerIn: parent text: "destroy" } MouseArea { anchors.fill: parent onClicked: { while(dyn.length > 0) { var temp = dyn.pop(); temp.destroy(); temp = null; } console.log("destroyed"); } } } Rectangle{ color: "gray" anchors.bottom: parent.bottom anchors.right: parent.right width : 100 height : 100 Text { anchors.centerIn: parent text: "gc" } MouseArea { anchors.fill: parent onClicked: { console.log("gc please"); gc(); } } } Rectangle{ color: "gray" anchors.bottom: parent.bottom anchors.left: parent.left width : 100 height : 100 Text { anchors.centerIn: parent text: "create timer destroy" } MouseArea { anchors.fill: parent onClicked: { for (var a=0;a<5000;a=a+1) { var newObject = Qt.createQmlObject('import QtQuick 2.0; Item { \ Rectangle { anchors.centerIn: parent; color: "blue"; width: 500; height: 500}}', main, "foo"); // Large array variable that can be inserted to QML to demonstrate that the accumulation is propotional, least partially, to code size. // property var biggie: [100,100,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500,100,200,300,400,500];\ if (newObject.qmlerrors) { console.log(newObject.qmlerrors.message); break; } newObject.destroy(1000); newObject = null; } } } } }