Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Running out of memory, how do I set a more memory compiler option?

Running out of memory, how do I set a more memory compiler option?

Scheduled Pinned Locked Moved Qt Creator and other tools
8 Posts 4 Posters 5.9k 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.
  • O Offline
    O Offline
    occam
    wrote on last edited by
    #1

    Hi
    I am compile a simple application in QT, on ubuntu linux (gcc), and am running into the error

    error: relocation truncated to fit: R_X86_64_32S against symbol 'scratchList' defined in .bss section in mainwindow.o

    my understanding is I have run out of compiler memory (over the 2 gig limit), but can extend this using the -mcmodel medium compiler option.

    How do I set this option in QT creator, my attempts so far have not worked.
    Thanks
    Occam

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mathias.gumzqt
      wrote on last edited by
      #2

      somehow "simple application" and "run out of memory for the compiler" kind of conflicts, at least in my head.

      can you provide more information about the "simple code" you are writing?

      1 Reply Last reply
      0
      • O Offline
        O Offline
        occam
        wrote on last edited by
        #3

        Ahh,
        Basically the code is simple, but requires a lot of memory.

        I am processing a lot of large files (about 6gig), and needing to create a series of memory arrays to store immediate results, about 3.25 gigs worth. The 64bit machine has 12 gig of memory, so I would prefer to put this to use, rather than slowing down, and making the process more complex by having to write intermediate results to disk.

        #define maxSize 80000000
        #define maxTypeB 100000000

        quint32 typeA[maxSize]; //305meg

        quint8 numberOfTypeB[maxSize]; //76meg

        quint32 citeList[maxTypeB]; //381meg

        quint32 citeFor[maxTypeB][2]; //762meg
        quint32 typeBtore[maxTypeB][2]; //762meg

        //OK up to here, the next 3 break the limit

        quint32 typeB[maxTypeB]; //381meg
        quint16 numberOfTypeA[maxTypeB]; //191meg
        quint32 typeAList[maxTypeB]; //381meg

        thanks
        Occam

        1 Reply Last reply
        0
        • L Offline
          L Offline
          lyuts
          wrote on last edited by
          #4

          You made the stack too big. What kind of file processing do you do?

          I'm a rebel in the S.D.G.

          1 Reply Last reply
          0
          • O Offline
            O Offline
            occam
            wrote on last edited by
            #5

            its basically indexing. Building a series of fast look up tables, which then get optimized and condensed on the final pass once the characteristic of the informations known. The intermediate tables are referenced a lot throughout the process, in an unpredictable order, so its important they are in memory.

            1 Reply Last reply
            0
            • D Offline
              D Offline
              DenisKormalev
              wrote on last edited by
              #6

              Maybe better will be to switch to heap instead of stack?

              1 Reply Last reply
              0
              • M Offline
                M Offline
                mathias.gumzqt
                wrote on last edited by
                #7

                [quote author="occam" date="1288950906"]

                #define maxSize 80000000
                #define maxTypeB 100000000

                quint32 typeA[maxSize]; //305meg
                [/quote]

                thats why i was asking to provide some code snippets :)

                well, use the HEAP instead of the STACK:
                @
                QVector<quint32> typeA(maxSize);
                @

                you could also leave out the 'maxSize' parameter and just add values to 'typeA', but that depends on your algorithm.

                1 Reply Last reply
                0
                • O Offline
                  O Offline
                  occam
                  wrote on last edited by
                  #8

                  thank you for the help,
                  moved most to the heap and all is fine.

                  Occam

                  1 Reply Last reply
                  0

                  • Login

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