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. Qt Ressource file size limit
Forum Updated to NodeBB v4.3 + New Features

Qt Ressource file size limit

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 4 Posters 2.2k 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.
  • M Offline
    M Offline
    mhtrinh
    wrote on 8 Feb 2018, 21:02 last edited by
    #1

    Hi,

    I am using Qt 5.6.2 on Opensuse 42.3 (kernel 4.4.90-28-default x86_64)
    I am trying to put about 1000 images of 3MB each in a ressource file (that would make a 3GB ressource file)
    I encounter this error when running rcc :

    $ rcc -o tmp.lic -binary -no-compress /dev/shm/genBundle/qrc.qrc
    ASSERT failure in qAllocMore: "Requested size is too large!", file ../../corelib/tools/qbytearray.cpp, line 73
    Aborted (core dumped)
    

    Is there any way around this ? I like the ressource system as I can pack all the files in one single file and have access to them without extracting them somewhere before using them in the application.

    R 1 Reply Last reply 9 Feb 2018, 12:26
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 8 Feb 2018, 21:10 last edited by
      #2

      Hi,

      You can split the resource file in smaller files.

      Out of curiosity, why that many images ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • M mhtrinh
        8 Feb 2018, 21:02

        Hi,

        I am using Qt 5.6.2 on Opensuse 42.3 (kernel 4.4.90-28-default x86_64)
        I am trying to put about 1000 images of 3MB each in a ressource file (that would make a 3GB ressource file)
        I encounter this error when running rcc :

        $ rcc -o tmp.lic -binary -no-compress /dev/shm/genBundle/qrc.qrc
        ASSERT failure in qAllocMore: "Requested size is too large!", file ../../corelib/tools/qbytearray.cpp, line 73
        Aborted (core dumped)
        

        Is there any way around this ? I like the ressource system as I can pack all the files in one single file and have access to them without extracting them somewhere before using them in the application.

        R Offline
        R Offline
        raven-worx
        Moderators
        wrote on 9 Feb 2018, 12:26 last edited by raven-worx 2 Sept 2018, 12:39
        #3

        @mhtrinh
        3GB!!!!
        you know that the resource is embedded into your executable at the end?!
        The resulted cpp file will be over 3GB of size. Then the compiler also need to link that 3GB+ file to create the binary file.
        And after all the whole 3GB+ executable will be loaded into the RAM on every startup.

        I suggest you just load the images from the filesystem on demand.

        --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
        If you have a question please use the forum so others can benefit from the solution in the future

        J 1 Reply Last reply 9 Feb 2018, 12:32
        4
        • R raven-worx
          9 Feb 2018, 12:26

          @mhtrinh
          3GB!!!!
          you know that the resource is embedded into your executable at the end?!
          The resulted cpp file will be over 3GB of size. Then the compiler also need to link that 3GB+ file to create the binary file.
          And after all the whole 3GB+ executable will be loaded into the RAM on every startup.

          I suggest you just load the images from the filesystem on demand.

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 9 Feb 2018, 12:32 last edited by
          #4

          @raven-worx Would be interesting to know how long it takes to compile/link this thing :-)

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          R 1 Reply Last reply 9 Feb 2018, 12:38
          0
          • J jsulm
            9 Feb 2018, 12:32

            @raven-worx Would be interesting to know how long it takes to compile/link this thing :-)

            R Offline
            R Offline
            raven-worx
            Moderators
            wrote on 9 Feb 2018, 12:38 last edited by
            #5

            @jsulm said in Qt Ressource file size limit:

            @raven-worx Would be interesting to know how long it takes to compile/link this thing :-)

            honestly i do not want to know ;)
            In my QrwAndroid lib i added the material icons (~19.500 files / about 20 MB IIRC) and it takes a about 4-5 minutes to run rcc, compile and link.

            --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
            If you have a question please use the forum so others can benefit from the solution in the future

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 9 Feb 2018, 12:40 last edited by
              #6

              In this case, the OP is generating an external binary resource.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              R 1 Reply Last reply 9 Feb 2018, 12:44
              0
              • S SGaist
                9 Feb 2018, 12:40

                In this case, the OP is generating an external binary resource.

                R Offline
                R Offline
                raven-worx
                Moderators
                wrote on 9 Feb 2018, 12:44 last edited by raven-worx 2 Sept 2018, 12:45
                #7

                @SGaist
                ok then the time and memory wasting happens delayed when the binary is loaded :)
                IMO it's still a pretty bad idea to load 3GB+ resource file at any point.

                --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
                If you have a question please use the forum so others can benefit from the solution in the future

                1 Reply Last reply
                2

                1/7

                8 Feb 2018, 21:02

                • Login

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