Running out of memory, how do I set a more memory compiler option?
-
Hi
I am compile a simple application in QT, on ubuntu linux (gcc), and am running into the errorerror: 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 -
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?
-
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 100000000quint32 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]; //381megthanks
Occam -
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.
-
Maybe better will be to switch to heap instead of stack?
-
[quote author="occam" date="1288950906"]
#define maxSize 80000000
#define maxTypeB 100000000quint32 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.