Unsolved Qt Ressource file size limit
-
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.
-
Hi,
You can split the resource file in smaller files.
Out of curiosity, why that many images ?
-
@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.
-
@raven-worx Would be interesting to know how long it takes to compile/link this thing :-)
-
@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. -
In this case, the OP is generating an external binary resource.
-
@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.