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

QIcon has increased memory usage because pixmaps are not loaded on demand

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P1: Critical
    • None
    • 5.7.0, 5.8.0
    • GUI: Painting
    • None
    • Windows 7 64bit, Precompiled Qt-Packages Qt 5.2.1 MinGW 4.8 , Qt 5.7 MinGW 5.3

    Description

      There is a significant increase of runtime memory consumption of up to 300% more memory when using QIcon in Qt 5.7 compared to Qt 5.2.1.

      The documentation says that images for an icon given from a file are loaded on demand, but it seems that this is not the case anymore.

      I attaches a zip file with a buildable example that creates a widget containing some comboboxes with the same icons for every item. It has two boolean command line options:

      • -i or --icon : use the QIcon constructor
      • -p or --pixmap : use the QPixmap constructor
        If you set both, the QIcon constructor will be used, if you set none no icons will be loaded.

      I measured the memory usage with the windows task manager. The results are the following:

      • QIcon Constructor (-i):
        • Qt 5.2.1: 5740 KB
        • Qt 5.7: 46472 KB
      • QPixmap Constructor (-p):
        • Qt 5.2.1: 7184 KB
        • Qt 5.7: 9712 KB
      • No Icons (no options):
        • Qt 5.2.1: 4636 KB
        • Qt 5.7: 8096 KB

      Attachments

        For Gerrit Dashboard: QTBUG-59621
        # Subject Branch Project Status CR V

        Activity

          People

            Unassigned Unassigned
            mmeyer Markus Meyer
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes