Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. FLAC file as resource causes compilation to fail
Forum Updated to NodeBB v4.3 + New Features

FLAC file as resource causes compilation to fail

Scheduled Pinned Locked Moved Unsolved General and Desktop
flacresourceout-of-memory
5 Posts 3 Posters 1.4k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    trollkatt
    wrote on 17 May 2016, 13:40 last edited by trollkatt
    #1

    Hello,

    I added a 40 MB FLAC file as a resource in QTCreator to a new QtQuick project. Unfortunately that causes complation to fail with the following message:

    virtual memory exhausted: Cannot allocate memory
    Makefile:630: recipe for target 'qrc_qml.o' failed

    When trying to compile a new project with a FLAC file, the cc1plus process will start eating up memory immediately - it fails even with 8 GB physical memory + 8 GB swapfile.
    When I compile another project with many PNG images (~20 MB), this does not cause any problems, and it barely registers in memory.

    Is this a bug or are there limitations in file types or sizes when it comes to the QT resource files?

    (System specs: Qt 5.6.0 ; Qt Creator 3.6.1; GCC 4.9.1 20140922 64 bits; Debian GNU/Linux 64 bits; downloaded from QT website (not repo); compiling for Android ARM7 and x86 desktop - same problem )

    (Edit: the version from the Debian repositories has the same problem. It uses the system's GCC instead, which is GCC 5.3.1 )

    K 1 Reply Last reply 17 May 2016, 16:03
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 17 May 2016, 15:37 last edited by mrjj
      #2

      hi
      Just tried on windows with 2x files from here
      http://www.eclassical.com/pages/24-bit-faq.html
      so ca 60 MB and it takes a moment but works fine.

      There should be no limit of type but all files are converted into array to compile into
      the code so it can get too big for compiler.

      Could it be the flag file itself somehow ?

      1 Reply Last reply
      0
      • T Offline
        T Offline
        trollkatt
        wrote on 17 May 2016, 15:42 last edited by
        #3

        Thank you for the reply!
        I tried it also with a 30 MB *.deb (a kernel package) and I had the same problem. I will try from Windows and see if it is a Linux-only problem.

        Additionally could you check the memory usage while compiling?

        Thanks!

        M 1 Reply Last reply 17 May 2016, 15:46
        0
        • T trollkatt
          17 May 2016, 15:42

          Thank you for the reply!
          I tried it also with a 30 MB *.deb (a kernel package) and I had the same problem. I will try from Windows and see if it is a Linux-only problem.

          Additionally could you check the memory usage while compiling?

          Thanks!

          M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 17 May 2016, 15:46 last edited by mrjj
          #4

          @trollkatt
          hi
          Did check mem usage. its almost stay at same.
          very little change. not anything like u see.

          Perhaps for good measure u can run my sample in linux?
          https://www.dropbox.com/s/6pwirw3jfl0h1ns/QRES_TEST.zip?dl=0
          (50 MB)

          1 Reply Last reply
          0
          • T trollkatt
            17 May 2016, 13:40

            Hello,

            I added a 40 MB FLAC file as a resource in QTCreator to a new QtQuick project. Unfortunately that causes complation to fail with the following message:

            virtual memory exhausted: Cannot allocate memory
            Makefile:630: recipe for target 'qrc_qml.o' failed

            When trying to compile a new project with a FLAC file, the cc1plus process will start eating up memory immediately - it fails even with 8 GB physical memory + 8 GB swapfile.
            When I compile another project with many PNG images (~20 MB), this does not cause any problems, and it barely registers in memory.

            Is this a bug or are there limitations in file types or sizes when it comes to the QT resource files?

            (System specs: Qt 5.6.0 ; Qt Creator 3.6.1; GCC 4.9.1 20140922 64 bits; Debian GNU/Linux 64 bits; downloaded from QT website (not repo); compiling for Android ARM7 and x86 desktop - same problem )

            (Edit: the version from the Debian repositories has the same problem. It uses the system's GCC instead, which is GCC 5.3.1 )

            K Offline
            K Offline
            kshegunov
            Moderators
            wrote on 17 May 2016, 16:03 last edited by kshegunov
            #5

            @trollkatt
            You shouldn't compile a resource this big into the binary to begin with! Load it at runtime instead. For example look at this thread.

            Read and abide by the Qt Code of Conduct

            1 Reply Last reply
            0

            1/5

            17 May 2016, 13:40

            • Login

            • Login or register to search.
            1 out of 5
            • First post
              1/5
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved