Results 1 to 3 of 3

Thread: Virtual memory exhausted compiling .qrc

  1. #1
    Join Date
    Feb 2010
    Posts
    18
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Virtual memory exhausted compiling .qrc

    Hi,

    I've added a single 100mb .avi file to a .qrc file but I'm getting the error:

    "virtual memory exhausted: Cannot allocate memory"

    I have 1.7gb memory and 3.0gb swap allocated in my Virtual Machine. I get this error when I load a 20mb tiff image too.

    The problem seems to be identical to this issue:

    http://www.qtcentre.org/threads/3812...mory-exhausted

    Now, the solution would be to remove the .avi from the resources file and load it at run time, I'm fine with that. I'd just like to understand what is going on. Looking at the system monitor my memory usage just increases to the max then it fails the build.

    Are the resources loaded multiple times when the moc is compiling? My understanding was the .qrc files would just be loaded into the apps executable, so if you have 100mb of resources the executable grows by 100mb. I'm just scratching my head as to why adding a 20mb resource would max out the RAM.

    Any advice is appreciated.

    Thanks


    Added after 8 minutes:


    I've just been reading the documentation on the Qt resource system.

    http://doc.qt.nokia.com/4.7-snapshot/resources.html

    The section 'compiled in resources' is pretty much what I understood was going on.
    Last edited by JonnyJP; 6th August 2012 at 15:36.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Virtual memory exhausted compiling .qrc

    I've added a single 100mb .avi file to a .qrc file but I'm getting the error:

    "virtual memory exhausted: Cannot allocate memory"
    Exactly what is generating this message? The Qt resource compiler (rcc), the C++ compiler, or the linker? You are asking the compiler and linker to handle a single object (C++ or file) above 100MB (the AVI/TIFF will not compress well) to produce an EXE of similar size. The compiler might choke building a syntax tree for 100000000 bytes in a single array.

  3. #3
    Join Date
    Feb 2010
    Posts
    18
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Virtual memory exhausted compiling .qrc

    Thanks. It's the compiler that is causing the error.So basically it's just that it can't handle massive source files?

Similar Threads

  1. Compiling Qt 4.8.2 results in "ld.exe: final link failed: Memory exhausted"
    By themagician in forum Installation and Deployment
    Replies: 8
    Last Post: 26th July 2012, 20:53
  2. virtual memory exhausted
    By kamlmish in forum Newbie
    Replies: 3
    Last Post: 27th January 2011, 06:11
  3. Error : Virtual memory Exhausted - while doing make
    By augusbas in forum Qt Programming
    Replies: 0
    Last Post: 10th June 2010, 13:12
  4. Virtual memory problem
    By Rahul in forum Qt Programming
    Replies: 1
    Last Post: 24th October 2007, 13:29
  5. Virtual Memory in Qt 4.2.2
    By Shuchi Agrawal in forum Newbie
    Replies: 3
    Last Post: 5th March 2007, 23:38

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.