Software Archive
Read-only legacy content
17060 Diskussionen

Memory demand

Intel_C_Intel
Mitarbeiter
677Aufrufe
The program I am working with is a numerical simulator allocating large data arrays (Windows NT, 98). For the program performance it is crucial that the application is not using virtual memory and stays within RAM.
I?d like to know if there is any command in Compaq Visual Fortran that can return total memory used by the running application? It would help me to define memory demands and optimize runs.

Thanks,
Andrei Zaostrovski
0 Kudos
1 Antworten
hbell
Einsteiger
677Aufrufe
Andrei,
I think you need to include the following lines in your code to inquire about currently available physical memory:
use kernel32
use dfwinty

type(T_MEMORYSTATUS) lpMstMemStat

call GlobalMemoryStatus ( lpMstMemStat )
write(*,*)
*'Bytes of physical memory available -> ',
* lpMstMemStat.dwAvailPhys

There are many other elements in the structure that can be queried as well.

But I have been puzzled at the operation of this command; it seems to result in a system memory leak. That is, when I run a simple program with the above successively routines I get less and less available memory. Maybe it's a quirk with my computer.
Also, does anybody know how to look up the CPU clock frequency?

Harry Bell
Antworten