Software Archive
Read-only legacy content
17061 Discussions

Out of memory errors

jim_sims
Beginner
742 Views
I am running Windows 98.

The F90 code I get the memory allocation error with is pretty simple:

program lm
real(8) :: x(:,:)
allocate (x(5800,5800)) !x is 269,120,000 bytes
end

The error message is

run-time error F6772
-cannot ALLOCATE ALLOCATABLE array - out of memory

Any request greater than 256M = 268,435,456 bytes fails. Note that this
program is all array x, so evidently the space occupied by the OS is not
involved. Makes sense. The limitation is on the program/process image
size.

How do I fix this?
0 Kudos
2 Replies
j_jimenez
Beginner
742 Views
You (or the system) cannot manage an array bigger than 256Mb because the pointer size would be bigger than it is allowed. May be on a 64 bit computer will work. (I don't know if other languajes can on 32 bit)
(Take a look to "Handling Arrays and Visual Fortran Array Descriptors" on Help)
Solutions: change computer and OS (64 bit) or try to manage smaller arrays, for example an array of arrays (slower, of course)
0 Kudos
Steven_L_Intel1
Employee
742 Views
Jimenez, thanks for replying, but 256MB is well within the limits of a 32-bit address.

Jim is not using Compaq Visual Fortran - he's using Microsoft Fortran PowerStation, which has internal limits such as the one he ran into. Compaq Visual Fortran does not have such a limit on allocatable arrays. For purchase information, please visit our web site.

Steve
0 Kudos
Reply