Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-62522

Loading QML files in 5.9 causes much higher memory consumption than in 5.6

    XMLWordPrintable

Details

    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

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              shausman Simon Hausmann
              alexbusenius Alex Busenius
              Votes:
              3 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes