LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Get Free memory size

Hallo,
I'm developing an application and I want to reach the RAM limit (points on waveform graph)for different computers equipped with different memory sizes. Is there any way to know the computer free memory size at run time?

Many thanks
Neona
0 Kudos
Message 1 of 2
(2,741 Views)
hi,

you can call

VOID GlobalMemoryStatus(
LPMEMORYSTATUS lpBuffer // pointer to the memory status structure
);

from kernel32.dll. it fills a structure

typedef struct _MEMORYSTATUS { // mst
DWORD dwLength; // sizeof(MEMORYSTATUS)
DWORD dwMemoryLoad; // percent of memory in use
DWORD dwTotalPhys; // bytes of physical memory
DWORD dwAvailPhys; // free physical memory bytes
DWORD dwTotalPageFile; // bytes of paging file
DWORD dwAvailPageFile; // free bytes of paging file
DWORD dwTotalVirtual; // user bytes of address space
DWORD dwAvailVirtual; // free user bytes
} MEMORYSTATUS, *LPMEMORYSTATUS;

You may be interested in the elements dwTotalPhys and dwAvailPhys.

best regards
chris
Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
Message 2 of 2
(2,730 Views)