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

Qt Ressource file size limit

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 4 Posters 2.2k Views
  • 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 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.

    raven-worxR 1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on 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

        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.

        raven-worxR Offline
        raven-worxR Offline
        raven-worx
        Moderators
        wrote on last edited by raven-worx
        #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

        jsulmJ 1 Reply Last reply
        4
        • raven-worxR raven-worx

          @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.

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on 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

          raven-worxR 1 Reply Last reply
          0
          • jsulmJ jsulm

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

            raven-worxR Offline
            raven-worxR Offline
            raven-worx
            Moderators
            wrote on 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
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on 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

              raven-worxR 1 Reply Last reply
              0
              • SGaistS SGaist

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

                raven-worxR Offline
                raven-worxR Offline
                raven-worx
                Moderators
                wrote on last edited by raven-worx
                #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

                • Login

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