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

QPainter::drawText with different fonts consumes huge amount of memory which does not get released

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P3: Somewhat important
    • Some future release
    • 4.7.4, 4.8.0, 4.8.1, 4.8.2
    • None
    • Windows 7 Professional x64

    Description

      With this code, my program consumes an additional 100MB of Memory on a Windows 7 x64 – MSVC10/MSVC9 computer using Qt 4.7.4, 4.8.0, 4.8.1 and 4.8.2. Also if the painting is done, the memory does not get released.

      Is this memory consumption normal?

      void MyWidget::paintEvent(QPaintEvent *event)
      {
        QPainter p(this);
        QFont f(p.font());
           
        int fHeight = height();
           
        for (int s=5; s<500; s++)
        {
          f.setPixelSize(s);
          p.setFont(f);
          p.drawText(0, fHeight, "Hello World");
        }
      }
      

      This code is just a sample to easily show the behaviour. In my case i have a lot of painting going on with different font sizes, which comes at the end to the same issue.

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            walteste Stefan Walter
            Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes