I am doing some extremely large array processing. I do a global declaration of:
`float array[200][1600][811];`
When I build my solution in MS Visual Studio 2010, I get the following error
LINK : fatal error LNK1248: image size (F85C8000) exceeds maximum allowable size (80000000)
Now, I am aware this amounts to about 1 GB of program memory. But this declaration worked for a declaration of float [50][1600][811]
which amounts to 250 MB. I know the default stack size is very limited.
There are a couple of things I have already tried. I increased the stack size in VS through Properties -> Linker -> Stack reserved size. This didnt help. I changed my executable to run in x64 mode (which is said to address upto 2GB memory!). This didnt help either.
I do not wish to do a malloc
on the array because I know for sure I need them in my code. I had to make them global declarations so that I can avail the stack/heap memory. If I declare them inside my Main ()
, it gives me error of memory overflow.
Any pointers would be greatly appreciated.
Thanks.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…