Software Archive
Read-only legacy content
17061 Discussions

Determining the amount of system memory

davidgraham
Beginner
512 Views
In my application, I load a lot of information into a large array, when the array is full I write further information to file.

With different PC's I sould be able to make the array bigger and so my application should run faster.

I therefore need to determine the amount of system memory so I can decide how big I can make my array.

Is there a call that will give me this?

Thanks,
David
0 Kudos
2 Replies
hbell
Beginner
512 Views
Here's how I find available physical memory with CVF 6.6:

use dfwin
use dflogm
use dfcom
(not sure which one of these is required)
...
type(T_MEMORYSTATUS) lpMstMemStat
...
call GlobalMemoryStatus ( lpMstMemStat )
ipmem_start = lpMstMemStat.dwAvailPhys
The last integer variable (ipmem_start) will have the amount of memory in bytes.

Harry Bell
0 Kudos
Steven_L_Intel1
Employee
512 Views
Note that physical memory is not the same as virtual memory. The dwTotalVirtual and dwAvailVirtiual fields are more interesting here.

Steve
0 Kudos
Reply