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

program crash/ insufficient virtual memory

jswaugh
Beginner
565 Views

Thiswas inadvertently posted to the Linux fortran forum.

Aprogram (release version) halts with the abovementioned message in the traceback window. The source line mantioned is ata CALL to a routine that will populate a large array, whichhas been allocated in the immediately preceding source line with a large size -- ~600 MB. The computer has 2GB of RAM and many GB of free disk space. My understanding has been that "virtual" memory refers to swap files, not RAM. Can anyone suggest what causes this problem and how it can be addressed: The program took more than 24 hours to reach the crash point, so quick and dirtyattempts at a fix are not helpful.

0 Kudos
3 Replies
Steven_L_Intel1
Employee
565 Views
2GB is the limit on 32-bit Windows, no matter how much RAM and swap space you have.
0 Kudos
jswaugh
Beginner
565 Views

I understand the 2GB address space of 32 bit Windows. I gather you are saying that the "virtual" memory reported by the program as lacking is referring to addressable memory not used by the program up to the crash point. If so, I wouldsuppose that the error should have occurred when an attempt to allocate the new memory was made, not when the offending array was passed to a routine that would populate it. I admit that my knowledge of programming doesn't extend tohow the stack, the heap, etc. work.

In any case, is there any diagnostic code I can build into the program that will report at any point how much of the 2GB limit is in use? I would have guessed that the memory used by the program up to the extra 600 MB required by the array is only a few MB. Care has been taken to allocate/deallocate large arrays on the fly so as to avoid this kind of problem.

0 Kudos
jimdempseyatthecove
Honored Contributor III
565 Views
Depending on how you pass the array, the call may perform an allocation in order to pass a section of the array as a temporary.
0 Kudos
Reply