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

insufficient virtual memory

lklawrie
Beginner
1,522 Views
I have a user file that is exiting with "insufficient virtual memory" as it's trying to allocate a large array.

Same thing happens on 64-bit version. (but a couple of lines later -- same size array)

Is there a specified limit on "too big" an array? Or is there a way I can test how much "virtual memory" is left and not let it be allocated?

0 Kudos
9 Replies
Steven_L_Intel1
Employee
1,522 Views
There is not really a way to do this because the limit can change dynamically depending on how the system is configured and what else is running. How full is the disk with the system swapfile? Do you know how large an array is being allocated at the time?
0 Kudos
lklawrie
Beginner
1,522 Views
Ran it on one where the system is virtually empty with the swap file.

The array is something like 136X902X4X18X24

32 bit systems seem to fail on the first of these. the 64 bit on the 3rd.

(64 bit is also virtually empty where the swap file is/should be).
0 Kudos
Steven_L_Intel1
Employee
1,522 Views
Well, assuming that the array is REAL(4), each one is some 848 million bytes. If REAL(8), about 1.7 billion bytes. No wonder there are issues on 32-bit systems. How much RAM on the 64-bit system?
0 Kudos
lklawrie
Beginner
1,522 Views
It is REAL(8). 3G on the 64 bit system, I think.

I reduced the 902 to 102 and it worked on all.
0 Kudos
SergeyKostrov
Valued Contributor II
1,522 Views
Quoting lklawrie
The array is something like 136X902X4X18X24

32 bit systems seem to fail on the first of these. the 64 bit on the 3rd.

(64 bit is also virtually empty where the swap file is/should be).


Hi Linda,

136x 902x 4x 18x 24 = ~202 MB * 8 bytes ( for Long Doubles ) = ~ 1.616 GB

On aWindows 32-bitoperating system a Win32 application can not use more than 2 GB of memory. This is
by design from Microsoft. It means, you're almost at that limit. It doesn't matter if you set aVirtual Memory
sizeto 16 GB, or 32 GB,for example.

On a Windows64-bit operating system there are no such limitations.If your application fails on the 3rd
attempt to allocatememory for the array it clearly indicates thatmemory wasn't released ( possibly )
after the 1st and 2nd attempts.

As a compromise you could change a data type to a single-precision ( 4 bytes ), but accuracy of
computationswill be affected.

You could alsouse a Task Manager toinvestigate what is going on whenthe application is trying to
allocate the array, especially ona 64-bit platform for the2nd and 3rd attempts.

Best regards,
Sergey

0 Kudos
lklawrie
Beginner
1,522 Views
Thanks, Sergey.

This may happen often enough that I will change those three arrays to single precision. I believe they are mostly used in some outputs and the precision may not be so important.
0 Kudos
SergeyKostrov
Valued Contributor II
1,522 Views
Hi Linda,

There is another less known option and it allows to change memory mappingfor a Windows 32-bit platforms.

A 32-bit Windowscouldbestarted with the /3GB option. Here is a link to Microsoft's Technet article:


http://technet.microsoft.com/en-us/library/bb124810(EXCHG.65).aspx

Please take a look if you're interested. But,the /3GB switch is supported only on the following operating
systems:

Windows 2000 Advanced Server
Windows 2000 Datacenter Server
Windows Server 2003 Standard Edition
Windows Server 2003 Enterprise Edition
Windows Server 2003 Datacenter Edition

Best regards,
Sergey

0 Kudos
SergeyKostrov
Valued Contributor II
1,522 Views
Quoting lklawrie
...is there a way I can test how much "virtual memory" is left and not let it be allocated?


I'll try to investigate itnext week.

Merry Christmas!

0 Kudos
SergeyKostrov
Valued Contributor II
1,522 Views

>>...Or is there a way I can test how much "virtual memory" is left and not let it be allocated?


Try to useWindows Task Manager because it is the easiest way to monitor how some resources are
allocated, used,etc.You can also use Perfmon.exe application on Windows XP, or Resource Monitor on
Windows 7.

Take a look at two screenshots:



0 Kudos
Reply