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

Monitor memory usage using the debugger

rafadix08
Beginner
630 Views
Hi,

I am using Intel Fortran 11 with Visual Studio.

I am having a problem that I am not able to allocate an array. Since the array is large and I already have several other big arrays stored before I try to allocate itI was wondering whetherI could somehow monitor memory usage using the debugger.

Is there a way to see how many bytes each array is occupying as the code progresses using the debugger?

Many thanks,
Rafael
0 Kudos
2 Replies
rafadix08
Beginner
630 Views
Also, if you have suggestions of what I could do in order to be able to allocate this large array, please let me know. Before anyone suggests, I did increase both the heap-arrays and the Stack Reserve options in the IDE to very big numbers.

0 Kudos
jimdempseyatthecove
Honored Contributor III
630 Views

Rafael,

Open MSDN help and enter in "heap". There are many functions available and there is a debug version of the heap. Note, IFV uses the CRTL heap. Of particular interest you might start with heapwalk.

Often the problem you are experiencing is due to one or the other of these reasons

1) too much memory allocated
2) heap memory gets fragmented due to allocate/deallocate sequencing
allocate big array
| big array |
allocate little thing
| big array |x|
deallocate big array
| (free)|x|
allocate other little thing
|y| (free)|x|
allocate big array
|y| (free)|x| big array |

This creates a series of not quite large enough free blocks

3) memory leak. Usualy in Fortran this is caused by allocating to pointer then forgetting to deallocate.

Also, search MSDN for LFH or "Low Fragmentation Heap". You may need to enable this.

Jim Dempsey




0 Kudos
Reply