From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

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,739 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,728 Views)