QML Loader leaks memory
-
Our leak is very serious, on a fully loaded QML (images and stuff) it leaks about 1MB per load. Which is really bad considering we have about 128MB total memory on the Windows CE device we use. We have to reboot the Windows CE device way to often. (several times a day, TPHB is not really happy about that, nor am I).
-
Hi altera,
I havent sort out this problem but rather to reduce start up delay leakage in my application i have loaded files only once and afterwards setting visible to true/false so finally i am not unloading file.
-
Yes, that is what I tried as well but sadly due to the memory constraints that pushed us up right to the maximum. Which caused more out of memory errors.
-
No I'm 100% sure on top of that I've recreated the leak using 2 empty QMLs
https://bugreports.qt-project.org/browse/QTBUG-26032?focusedCommentId=179280#comment-179280
-
One thing that I did notice is that when I add
@m_View->engine()->clearComponentCache();@
The leak is 10 times worse!
-
This is all rather scary. Happens for me, too - due to big JPGs/PNGs loaded, it adds +40MB per unload.
-
4.7.4 + 4.8.2 I have not tested 5 since we require Windows CE support.
-
In my case:
4.7.4, 4.8.1 - QtQuick 1.
Qt5.0.0 - QtQuick 2. -
The "bugtracker":https://bugreports.qt-project.org we usually call "Jira" (after the name of the system it is using). If you report a bug, please:
Put a link to this forum topic in the bugreport, and
Put a link to the bugreport in this forum topic.
-
Firstly, why is anyone calling clearComponentCache() in QtQuick 1? You have to be extremely careful about the circumstances in which you do so, or all sorts of craziness can occur.
In QtQuick2, I seem to recall that we added / changed the functionality significantly (and updated the documentation) to clearly reflect what those functions should be used for and how.
It's been a while, though, and my memory isn't too great. If someone can link the JIRA task I can take a brief look, but I can't promise to spend too much time on it, unfortunately.
Cheers,
Chris. -
I'm not sure if there are leaks.
I added to my qml pages:
@
Component.onDestruction:{
componentX.destroy()
componentY.destroy()
componentZ.destroy()
}
@
for every nested componentand I'm using http://www.sikuli.org/ to test the complete flow (6 pages with many images). I had used my app 2000 times and there is not delay or crash.
Hope this helps