-
Bug
-
Resolution: Done
-
P1: Critical
-
None
-
4.7.3
-
None
-
8570c509f505a4b238905122645a80faa768adb5
I made a test app that has three Pages and utilizes a PageStack to navigate to
some pages and back automatically, repeatedly.
The memory consumption of the application keeps rising at a steady pace,
apparently without any limit. When investigating the heap with massif, the 2nd
most increase in heap usage was from QDeclarativeBinding constructor.
After some investigation, to me it seems like the leak is in function
QDeclarativeState::apply(). The leaking binding is stored first in
action.fromBinding (line 629 of qdeclarativestate.cpp), then in some
circumstances it is not deleted, but further stored into additionalReverts and
further to d->revertList. When doing the actual transition in
QDeclarativeTransitionManager::transition(), the binding is removed from the
property, and thus not released when the property is destroyed. The revertList
is lost when the QDeclarativeState is destroyed.
I made a small change (attached) causing the memory to be released and re-ran my tests
with the modified Qt libraries. Memory usage of both versions visualized in the
attachment; green without this patch, blue with this patch.
I also tried other QML apps with the patch in place and didn't notice any problems.