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

Heap Error

franzw82
Beginner
574 Views
Hi,

when executing a Fortran program (32-bit) I get the error message

"Fatal Error: Can not initiate the Heap"

The code is really large and I have not succeeded in producing a minimal example where the error occurs. My only clue is that the error occurs more or less directly after the allocation of a larger memory segment via malloc fails (malloc returns 0).

I first thought this is a bug in the compiler 2011.9.300. So I went back to version 11.1.072, but unfortunately the error still occurs. I have tried several runtime checks (check for null pointers, check array and string bounds, etc.), however these checks are all ok. I also tried Intel Inspector XE 2011 which could not find the problem -- it says that it ran out of memory.

Any ideas for tracking this down? Thanks in advance.

Franz








0 Kudos
2 Replies
Steven_L_Intel1
Employee
574 Views
My guess is that you've run out of address space. I see no evidence of a compiler bug in what you have posted so far. How much memory are you allocating? Why are you using malloc rather than ALLOCATE?
0 Kudos
SergeyKostrov
Valued Contributor II
574 Views
Quoting franzw82
...
"Fatal Error: Can not initiate the Heap"
...
Any ideas for tracking this down? Thanks in advance.


1. On32-bit Windows platformswithout AWE an application can not allocate more than 2GB of memory

2. On32-bit Windows platformswith AWE an application can allocate more than 2GB of memoryup to ~3GB

Here are some recommendations:

1. Try to use the Task Manager and monitor how much memory isallocated when your application gets the error.
The values to look at are as follows:

Performance property page:
Commit Charge (K) -> Peak
Physical Memory (K) -> Available

Processes property page ( You need to select columns ):
Mem Usage
VM Size

2.Verifysize of the Virtual Memory file and increase if needed ( on my system I have 1,024MB for Initialand 4,096MB for Maximum)

3. Try to call a'GetLastError' Win32 API function after a'malloc' calland in your casean error codehas
to be 8( ERROR_NOT_ENOUGTH_MEMORY ) ( this is simply to verify )

4. Try to increase Heap ( Reserve / Commit ) values.16MB values worked well in a similar caseand it isconfirmedby
a FORTRAN developer 2 days ago but in your case it is still not clear how much memory your application attempts to allocate

Note: AWE - Address Windowing Extensions

0 Kudos
Reply