Possible memory leak of gradient animation
-
So far it seems not like a bug but intended caching.
I tried to remove/create this tree path every time the animation starts but no RAM is released:property var tree: Qt.createComponent("TreeShape.qml").createObject(pathWin) NumberAnimation { id: goAnim running: true target: pathWin property: "grAnim" from: 0; to: 1 duration: animDur onFinished: { animDur = 500 + Math.random() * 10000 tree.destroy() tree = Qt.createComponent("TreeShape.qml").createObject(pathWin) backAnim.start() } }
So maybe it would be more proper to ask how to clean this cache?
-
So far it seems not like a bug but intended caching.
I tried to remove/create this tree path every time the animation starts but no RAM is released:property var tree: Qt.createComponent("TreeShape.qml").createObject(pathWin) NumberAnimation { id: goAnim running: true target: pathWin property: "grAnim" from: 0; to: 1 duration: animDur onFinished: { animDur = 500 + Math.random() * 10000 tree.destroy() tree = Qt.createComponent("TreeShape.qml").createObject(pathWin) backAnim.start() } }
So maybe it would be more proper to ask how to clean this cache?
-
@SeeLook from your description, this doesn't really seem like a true memory leak; it's more just a really memory-intensive application. I'm assuming that once it hits the 300 MB mark, it remains relatively steady?
@mzimmers
Unfortunately not.
The app is working on 1GB device and it crashes after 30 min of work exactly because of this kind of animation.
So I'm looking for solution.
If there is no simpler way, maybe I will try to implement that in C++ usingQQuickPainedItem
. -
@mzimmers
Unfortunately not.
The app is working on 1GB device and it crashes after 30 min of work exactly because of this kind of animation.
So I'm looking for solution.
If there is no simpler way, maybe I will try to implement that in C++ usingQQuickPainedItem
. -
@jsulm
Ok. Let's try. But please help me to interpret it:
memAtPeak.png
I can see that
QQuickShapeGradientOpenGlCache
takes 16 MB at peak but only 357 KiB at start.
Shall I share this massif tool dumped data? -
@jsulm
After about 20 min.
massif_20min.png
.. and probably it would grow and growHere is full massif file
@SeeLook Could be a bug in Qt. You can file a bug at https://bugreports.qt.io/secure/Dashboard.jspa
-
The problem is that every unique value of
grAnim
causes a new texture to be generated and stored in the cache: https://bugreports.qt.io/browse/QTBUG-136553