Details
-
Bug
-
Resolution: Cannot Reproduce
-
P1: Critical
-
None
-
5.9.2
-
None
Description
I have compared memory consumption of a test case that loads 1000 different QML types using branch origin/5.6 with this patch from QTBUG-61536: https://bugreports.qt.io/secure/attachment/64728/0001-Fix-memory-of-QML-type-registry-not-freed-when-clear.patch and latest origin/5.9 branch where all those patches were merged.
According to TC-Malloc (Bytes in use by application), there is a big difference between Qt versions:
In 5.6, the total memory consumption grows by 2 MB from 30.5 to 32.5 MB
In 5.9, the total memory consumption grows by 30 MB from 31.5 to 61.5 MB
It looks like 5.9 could have a regression that causes high memory consumption when types are loaded.
See test project and valgrind log (difference between loading 9 and 107 types) attached.
Steps to use the test project (only tested on linux):
- install tcmalloc and/or valgrind
- ./generate.sh 2000
- to use tcmalloc: qmake CONFIG-=valgrind
- to use valgrind: qmake CONFIG+=valgrind .
- make
- ./run Test.qml
- click on small yellow rectangle to run GC and trim component cache
- click on small green rectangle to print tcmalloc or valgrind memory stats
- click on white background to start loading
- wait until 1000 components were loaded, then click on white background to stop loading
- click on small yellow rectangle to run GC and trim component cache
- click on small green rectangle to print tcmalloc or valgrind memory stats
- you can click red rectangle to clear component cache as well
Attachments
Issue Links
- is required for
-
QTBUG-63067 Performance and memory consumption improvements for QtQml
-
- Closed
-