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

Loading multiple (small) jpeg files -> out of memory

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • 4.7.4
    • 4.6.3
    • None
    • Nokia N8 / Nokia E7 with stock ROMs as released

    Description

      Hello,
      I have a strange issue. The code segment below works perfectly on a Nokia N97 mini, an N97, a C6 etc:

      int main(int argc, char *argv[])
      {
          QMyApplication a(argc, argv);
          
          QPixmap pixmap(":/backgrounds/rsc/logo.bmp");
          QSplashScreen *splash = new QSplashScreen(pixmap);
          splash->showNormal();
          
          splash->showMessage(QObject::tr("Starting up..."));
          prefs.initPrefs();
      	globSoundMixer=CSoundMixerContainer::NewL();
      	globSoundMixer->StartMixer();
          qApp->processEvents();
          
          splash->showMessage(QObject::tr("Loading images..."));
          qDebug("Load 1");
      	levels[0]=new QPixmap(":/backgrounds/rsc/0.jpg");
      	levels[1]=new QPixmap(":/backgrounds/rsc/1.jpg");
      	levels[2]=new QPixmap(":/backgrounds/rsc/2.jpg");
      	levels[3]=new QPixmap(":/backgrounds/rsc/3.jpg");
      	levels[4]=new QPixmap(":/backgrounds/rsc/4.jpg");
      	levels[5]=new QPixmap(":/backgrounds/rsc/5.jpg");
      	levels[6]=new QPixmap(":/backgrounds/rsc/6.jpg");
      	levels[7]=new QPixmap(":/backgrounds/rsc/7.jpg");
      	levels[8]=new QPixmap(":/backgrounds/rsc/8.jpg");
      	levels[9]=new QPixmap(":/backgrounds/rsc/9.jpg");
      	levels[10]=new QPixmap(":/backgrounds/rsc/10.jpg");
          qApp->processEvents();
          qDebug("Load 1 end");
      

      But when I run it on a Nokia N8 or a Nokia E7, I get out of memory errors even if the phone has been rebooted just seconds before. The debug output is as following:

      [Qt Message] Load 1
      [Qt Message] QImage: out of memory, returning null image
      [Qt Message] QImage: out of memory, returning null image
      [Qt Message] QImage: out of memory, returning null image
      [Qt Message] QImage: out of memory, returning null image
      [Qt Message] QImage: out of memory, returning null image
      [Qt Message] QImage: out of memory, returning null image
      [Qt Message] Load 1 end
      

      If I reduce the number of load commands, the errors disappear (max 4). As ther JPEGs are small (640x360) and other phones have no eekers loading them, I am sure that this is an error of sorts in the phone OS.

      I would love to share the project's source code - but I cannot upload it publicly.

      All the best
      Tam Hanna

      Attachments

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

        Activity

          People

            jhautaka Jani Hautakangas
            tamhanna Tam Hanna
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes