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

forrtl severe (41) insufficient virtual memory - only on desktop, notebook works

Pedro_C_2
Beginner
7,096 Views

Hello there,

i really need some help here. Im using a Fortran program that has to alocate a little more than 1GB of memory to run.

 

My PC has 8GB of RAM and my laptop too. Both are Core i5.

 

In the laptop the program works flawlessly. In the PC, IF I alocate more than 1GB of ram, I get the following error:

 

 

Allocating ARRAYS in solve0

 

 Required space =        1130 Mbytes
forrtl: severe (41): insufficient virtual memory
Image              PC        Routine            Line        Source
SOLVER.exe         005395C0  Unknown               Unknown  Unknown
SOLVER.exe         004FC016  Unknown               Unknown  Unknown
SOLVER.exe         004E80A2  Unknown               Unknown  Unknown
SOLVER.exe         004DF522  Unknown               Unknown  Unknown
SOLVER.exe         0044A2C3  Unknown               Unknown  Unknown
SOLVER.exe         0046AF8E  Unknown               Unknown  Unknown
SOLVER.exe         0053AC33  Unknown               Unknown  Unknown
SOLVER.exe         005212ED  Unknown               Unknown  Unknown
kernel32.dll       765D338A  Unknown               Unknown  Unknown
ntdll.dll          772A9F72  Unknown               Unknown  Unknown
ntdll.dll          772A9F45  Unknown               Unknown  Unknown

Is exactly the same .exe using the same input data.

 

How do I make the program to work in the PC? any help here?

 

in Attachment a picture of my task manager showing the amount of available memory

0 Kudos
7 Replies
John_Campbell
New Contributor II
7,096 Views

1 GB is a small paging size to fail on. You could run task manager to see if other processes are using all the paging space.

You did not mention the operating system, but on Win 7 to change paging size:
Go to Control Panel > System > Advanced System Settings > Advanced > Performance Options > Advanced > Virtual memory > Change...
You could either:
 select "Automatically manage paging file size" , or
 "Custom size"
and put in sensible values, say Initial 16384 MB, Maximum 32768 MB

I suspect the values selected are too small.

If this is not the case then there must be some other problem.

0 Kudos
jimdempseyatthecove
Honored Contributor III
7,096 Views

>>SOLVER.exe         004DF522  Unknown               Unknown  Unknown

The 004DF522 indicates you are running a 32-bit application. Can you recompile and run as 64-bit (assuming your O/S is 64 bit capable)?

The maximum application size on 32-bit Windows is either 2GB or 3GB depending on a configuration switch in BOOT.INI. Default is 2GB.

One reference: https://knowledge.autodesk.com/support/autocad/troubleshooting/caas/sfdcarticles/sfdcarticles/How-to-enable-a-3GB-switch-on-Windows-Vista-Windows-7-or-Windows-XP-s.html

Jim Dempsey

0 Kudos
Pedro_C_2
Beginner
7,096 Views

Hi all,

 

thanks a lot for all the answers. So, both my systems in Desktop and Laptop are 64 bits (windows 7)

. Both have "Automatically manage paging file size" on

Anyway I tried incresing the page file to 16 GB minimum and 32 GB maximum an no luck too

And about the bits: You are right, the program is compiled for 32 bits. But the weird thing is that it works on my laptop (the same program, so, 32 bits). Before re-compiling for 64 bits, could you please give me another hint?

 

I attached in the first post a picture of task manager in the Desktop, but, in resume, I have 3890 mb of RAM in cache, 4080 of ram a available and 237 mb free.

0 Kudos
jimdempseyatthecove
Honored Contributor III
7,096 Views

The problem with 32-bit applications is the default behavior on Windows is the low half of the address space (half of 4GB, or 2GB) is available for application space, and the other half is available for system space.

The BOOT.INI (and other techniques in the link provided) changes the dividing point between application space and system space to provide the application with 3/4ths the address space (3GB for application, 1GB for system).

One possibility why it works on one system and not the other, is the working system may be set for 3GB application space, and the other for 2GB application space. These ratios are per process that runs in your system (process is generalized to be "application").

The amount of physical RAM or page file size cannot increase the 32-bit address space to be larger than 4GB total (2/2 or 3/1), though it could reduce it.

A second possibility is you just got lucky.

The particular error you got is (I believe) running out of heap space. What you might be able to do, is to reduce the amount of stack space. If you are building your application, then reduce the amount of stack (not, this too may break your program if too small). If your program is an .EXE built by someone else, then from a command prompt

dumpbin /headers YourFileNameHere.exe

Then use

editbin /STACK:newSizeHere YourFileNameHere.exe

to set the stack size (note, save the original size so you know where you came from).

Also, if your program is multi-threaded, you may be able to reduce the number of threads (assuming adjusting stack size did not work). Each thread requires stack space, the more threads you use, the less heap is available.

Jim Dempsey

0 Kudos
Pedro_C_2
Beginner
7,096 Views

Hi Jim,

 

just to align our thoughts: The application is 32 bit, but both systems are 64 bit. The BOOT.INI has an influence even on 64 bit windows?

0 Kudos
jimdempseyatthecove
Honored Contributor III
7,096 Views

*** Before you set large address aware be aware that this can introduce errors in programs if addresses are being compared using signed integers. Only when all address comparisons are performed using unsigned integers (32 bit) will it be safe to enable this feature (for 32-bit applications).

You might need to use editbin to set the flag IMAGE_FILE_LARGE_ADDRESS_AWARE in the image header

editbin /LARGEADDRESSAWARE:YES YourProgramNameHere.exe

And/or

BCDedit /set increaseuserva 3072

See:

https://msdn.microsoft.com/en-us/library/bb613473.aspx

https://msdn.microsoft.com/en-us/library/ff542202.aspx

https://msdn.microsoft.com/en-us/library/windows/desktop/bb613473(v=vs.85).aspx

https://social.technet.microsoft.com/Forums/windowsserver/en-US/a8c081b7-0f06-498a-8923-58cd6c1c1f85/memory-limitations-of-32-bit-apps-on-64-bit-terminal-server-2008-standard?forum=winserverTS (last post)

https://msdn.microsoft.com/en-us/library/aa384219(VS.85).aspx

https://msdn.microsoft.com/en-us/library/ms680349(v=vs.85).aspx

 

0 Kudos
Steven_L_Intel1
Employee
7,096 Views

Your program is asking for more than 1GB of contiguous memory. It may be that on the desktop enough other software loads into your address space that there isn't that big a single chunk of virtual address space available. RAM has little to do with it. Since both your systems are 64-bit I would recommend rebuilding as a 64-bit application.

0 Kudos
Reply