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

How to see memory usage??

Pipa
Beginner
726 Views
Hi all,
I am new to fortran, so I am just trying to know how fortran code uses memory.
I run a fortran program and want to look up how much memory it uses while its running. I look at the task manager(windows XP) to know the memory usage.
I am using the following code to know how much memory my arrays are using:
>>>>
allocate(a(nx))
............
............
............
.............using a() here..........
..........
.........

pause -----[1]

dealocate(a)
pause-----[2]

>>>>>>>>>>

I check the task manager at [1] and [2].
When I ran the code with multiple arrays (instead of just one), I didn't see any significant change in memory at [1] and [2] pause statement. I am just wondering if there is any other program which can tell me 'not so significant' memory changes?

Thanks.
0 Kudos
2 Replies
jimdempseyatthecove
Honored Contributor III
726 Views

The Windows Task Manager will tell you how much of the programs virtual memory has been accessed. On a Win32 system all programs get 4GB of address, 2GB (or up to 3GB) of address is available to the application, 1GB of address is available for Windows as accessable by your application.

This virtual memory is not committed (assigned to portions of the Pageing File) to your application untilthe applicationtouchesthe memorywith either a read or write. Once it touches the memory this commited virtual memory stays with the application as long as it exists (there are some system calls that will return this).

The application allocation heap will initialy have the remainder of the 2GB (or 3GB) address available, almost all of which is not-committed. As allocations occur you will see the applicationmemory footprint increase but not decrease. (The footprint will decrease if your application makes the system calls to inform Windows that a given address range is no longer required.)

Jim

0 Kudos
david_jones
Beginner
726 Views
Task manager (under Win2000 at least) has various optional columns of information, some of which maybe more suited. Look under View>Select Columns for "Virtual Memory Size" (VM Size) which typically has smaller values than "Mem Usage" or "Peal Mem Usage".
0 Kudos
Reply