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

EXE vs DLL - out of memory

lklawrie
Beginner
921 Views

We issue our software in several flavors including a DLL and EXE version. Recently, one of the software interfaces (third party) had a model that ran out of memory with the DLL version but ran okay with the EXE version.

Any hints as to what compiler flags I might use so the DLL will properly execute? Or is that not the issue? (i.e., is it something in their memory space -- before they launch the DLL?) I did not ask him if he launched his exe run from within the interface or outside (they can do both).

Linda

0 Kudos
7 Replies
Steven_L_Intel1
Employee
921 Views
Please elaborate - what is the exact error message? If it is a failure to allocate dynamic memory, the user's own EXE may be large or bringing in other large DLLs that eat up address space. If you run the EXE under the Visual Studio debugger and select Debug > Windows > Modules, you can see everything that is loaded into the address space.
0 Kudos
lklawrie
Beginner
921 Views

Apparently, you can't paste a image into here.

The error message is:

forrtl: severe(41): insufficient virtual memory

I have not duplicated this at "home" yet.

after a bunch of trace messages, it says:

stack trace terminated abnormally.

Linda

0 Kudos
lklawrie
Beginner
921 Views

I think I've attached the traceback file.

Linda

0 Kudos
Steven_L_Intel1
Employee
921 Views
Ok - that looks as if it may be coming from an ALLOCATE in your code - is it? How large an allocation is it?
0 Kudos
lklawrie
Beginner
920 Views

Yes, it is an allocate and no, I don't know how big because it's in a "reallocate" subroutine where it allocates a structure that is (about 550 bytes long) by the number of "variables" which can get rather large and gets reallocated and repopulated when it reaches the limit.

Remember the exe of the same vintage does not run out of memory.

Linda

0 Kudos
Steven_L_Intel1
Employee
920 Views
Yes, but there's the size of the user's EXE and what it may pull in that may push things over the limit.
0 Kudos
jimdempseyatthecove
Honored Contributor III
920 Views

Linda,

Since it appears you have an

allocate, populate
on full, reallocate, continue populate
on full, reallocate, continue populate
...

Can you supply a parameter (environment variable, value in file, etc...) to provide for an innitial allocation and an expansion incriment. Then set to large enough values to reduce the number of reallocations.

The problem may be with sequencing of allocations that causes memory fragmentation (or an Operating System behavior relating to delay of deallocations to protect against buffer re-use after deallocation bugs and/or exploits).

Jim Dempsey

0 Kudos
Reply