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

In a Heap a trouble!

bmchenry
New Contributor II
955 Views
Saw some threads on what to do to reduce stackuse for temp variable ala /heap-arrays
tried it but still having some issues.
Its a IVF dll called from c++, so the issue may be on the c++ side.
Just so i can also investigate from my end, i have aquestions:
To specify a change/increase in Heap size, what's a good way to go about determining what size to use?
What would you as fellow IVF user utilize to memory map your application and detemine stack and/or Heap size allocation?

Thanks!

brian
0 Kudos
3 Replies
Steven_L_Intel1
Employee
955 Views
You cannot specify the heap size. That is determined by Windows and is a function of your memory size and pagefile size. On 32-bit Windows, there's a maximum of 2GB for the heap, stack, program code and data combined.

What issues are you having?
0 Kudos
bmchenry
New Contributor II
955 Views
The dll i create is a re-entrant simulation. and after a couple hundred or socallsontest systems would give anerror:
Unhandled exception has occurred in your application.
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

and when run in debug mode (from IVF) it gave
HEAP[XYZ.exe]: Heap block at 1CCFDFE0 modified at 1CD01B43 past requested size of 3b5b Windows has triggered a breakpoint in XYZ.exe
the 'XYZ.exe' is a 3rd party c++ program which called the IVF dll.
so it got me looking into Stacks and heaps and all that FUN stuff!(stuff i normally don't deal with in daily programming tasks) to see if possibly my dll was the issue (the 3rd party was on other side of world).
Checked with Windows Task Manager and theResource Monitor. But neither gave a breakdown of initial memory requrements and how they changed as the DLL was called multiple times.
I was just looking for what utilities IVF users used to monitor memory, etc on applications (I've recently downloaded VTune and wonder, will that provide more insight?)

As far as the memory issue, after i posted the thread this morning, i heard back from other side of world and itended up being a C++ issue and has been corrected by the XYZ.exe programmer.
Maybe i won't have to revisit Stack/Heap issues, but still curious about where to go to find out more?
(I note there is another thread which came on board about the time i posted this titled 'Memory/Size of a program' (http://software.intel.com/en-us/forums/showthread.php?t=81614&o=a&s=lr) which is somewhat along the same lines)

Thanks for your response.

Brian

0 Kudos
Steven_L_Intel1
Employee
955 Views
The particular error you saw indicates that the program is writing outside an allocated memory block. This is a program bug like an array bounds error, nothing to do with heap size.
0 Kudos
Reply