Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29249 Discussions

Fatal error LNK1248: image size (93B5D000) exceeds maximum allowable size (80000000)

emailergrand
Beginner
6,334 Views
Hello,

I am using very large arrays, but also have a lot of memory, so theoretically that should not be a problem. But I am getting this error at the build stage:

"fatal error LNK1248: image size (93B5D000) exceeds maximum allowable size (80000000)"

Could you please help to sort out with this? How to tell the compiler to use more memory (IVF 2011, Windows 7).

Thank you in advance!
0 Kudos
14 Replies
Steven_L_Intel1
Employee
6,334 Views
It is a problem. Windows limits static code and data to 2GB, and you have exceeded this. Even on 64-bit Windows, no matter how much memory you have, the 2GB limit for static (non-allocatable) data remains.

The solution is to change the arrays from being declared with fixed bounds to being allocatable, and then using ALLOCATE to make them the desired size. If you are on a 64-bit system, this will allow you to have larger arrays. But if you are on a 32-bit system, you cannot go larger than 2GB.
0 Kudos
emailergrand
Beginner
6,334 Views
Thank you Steve,
I am on a 64 bit system.
I tried using allocatable arrays, but then I got an error when trying to pass this array from the main program to the subroutine. Do you know what is the limit for allocatable arrays?
0 Kudos
Steven_L_Intel1
Employee
6,334 Views
There is no particular limit for allocatable arrays. Be sure that you are building an "x64" configuration and not "Win32". What error did you see?
0 Kudos
Andrew_Smith
Valued Contributor I
6,334 Views
Did you also change the declaration of the dummy argument to an automatic shape, i.e. real(8) array(:)
0 Kudos
Steven_L_Intel1
Employee
6,334 Views
You don't need to do that if you are passing the whole array or a contiguous slice. And if you did make that change, you would also have to make an explicit interface visible to the caller.
0 Kudos
emailergrand
Beginner
6,334 Views
I have made the following declaration:
double precision, allocatable :: Array (:,:)


Then I use it in the following way in the body of the program:
...
allocate (Array(X,Y))
call MySubroutine(Array)
...



Then I get the following error:


Microsoft Visual C++ Debug Library:

Program...
File: f:\dd\vctools\crt_bld\self_64_amd64\crt\src\wincig.c
Line: 417

Expression: ("invalid signal or error, 0")


Just to clarify, I do not have any C++ code, only Fortran code in my project. Do not know why is this "wincig.c" here.
0 Kudos
Steven_L_Intel1
Employee
6,334 Views
That message is coming from down inside the run-time library. There is probably another message in your console window. What does the declaration of MySubroutine look like? (Names and declarations of arguments.) What you have written is ok as far as it goes, but there's not enough infomation to know exactly what is wrong.
0 Kudos
emailergrand
Beginner
6,334 Views
Inside mySubroutine, I declare Array as follows:

double precision, dimension (X, Y) :: Array

The values X and Y are made available to all subroutines through the use of the Module that is used by all subroutines.

The error in the console is as follows:

forrtl: severe (170): Stack overflow

my_main_program_name.f90 .....
kernel32.dl ....
ntdll.dll ...
0 Kudos
Steven_L_Intel1
Employee
6,334 Views
Ok. This error means that the compiler was asked to create a large temporary array as a result of an array expression. It can also happen if you declare an "automatic array", a local array whose dimensions depend on other variables. Is this error happening as soon as the program enters the subroutine or is it within the executable lines of the subroutine.

If you are using Visual Studio, try setting the property Optimization > Heap Arrays to 0. From the command line use /heap-arrays . For more information, see Doctor Fortran in "Don't Blow Your Stack!"
0 Kudos
emailergrand
Beginner
6,334 Views
If you are using Visual Studio, try setting the property Optimization > Heap Arrays to 0.

Thank you very much, this worked!

0 Kudos
lccostajr
Beginner
6,334 Views
Steve,
This Windows limitation of 2GB is related to the size of each block (COMMON) or to the size of the program as a whole?
In other words, if I have a large common block, would it make any difference if I split the common in smaller sized commons?

0 Kudos
Steven_L_Intel1
Employee
6,334 Views
It is the total size of all statically allocated code and data in a given image section. Splitting the COMMONs into smaller ones won't help. I suggest using ALLOCATABLE arrays instead.
0 Kudos
lccostajr
Beginner
6,334 Views
Thanks for your prompt help Steve.
0 Kudos
SergeyKostrov
Valued Contributor II
6,334 Views
Quoting emailergrand
..."fatal error LNK1248: image size (93B5D000) exceeds maximum allowable size (80000000)"...

I had a similar error with a 32-bit compiler when I tried to declare a 16,384x16,384matrix. It looks like
you tried to declare a largermatrix:

0x93B5D000 = 2,478,166,016 bytes and this isa ~24,890x24890single-precisionmatrix.
0 Kudos
Reply