Limit on QRC item file size?
Unsolved
General and Desktop
-
I was wondering if there was a limit on how big a file you can add to the QResource, and I created a random data file that was only 256MB in size, but trying to compile it my computer ran OOM (32 GB RAM). Is there anyway to simply add a few flags or some other qt magic to let me compile this QRC file without the OOM problem?
-
This is how to reproduce the OOM
testqrc2binary ├── data.bin ├── main.cpp ├── main.qrc └── testqrc2binary.pro $ dd if=/dev/urandom bs=$((1024*1024)) count=256 status=progress > data.bin $ cat main.cpp #include <QCoreApplication> #include <QFile> #include <QTimer> int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); QFile f("://data.bin"); f.open(QFile::ReadOnly); QTimer::singleShot(250, &a, &QCoreApplication::quit); return a.exec(); } $ cat main.qrc <RCC> <qresource prefix="/"> <file>data.bin</file> </qresource> </RCC> $ cat testqrc2binary.pro QT -= gui CONFIG += c++11 console CONFIG -= app_bundle DEFINES += QT_DEPRECATED_WARNINGS SOURCES += main.cpp qnx: target.path = /tmp/$${TARGET}/bin else: unix:!android: target.path = /opt/$${TARGET}/bin !isEmpty(target.path): INSTALLS += target RESOURCES += \ main.qrc