Is there is function in C that allows you to see how much memory the pc has left at that particular time?
Check memory
Collapse
X
-
On what OS.
On Windows then the answer is not really. You can find out how much memory is in use but in these days of expanding swap files providing extra virtual memory as required the question "how much memory is left" does not really make sense because the answer is "how much would you like there to be?". -
Originally posted by BanfaOn what OS.
On Windows then the answer is not really. You can find out how much memory is in use but in these days of expanding swap files providing extra virtual memory as required the question "how much memory is left" does not really make sense because the answer is "how much would you like there to be?".
Because I thought it would be a cool addtition for my program to have a thing which tells you how much RAM you have left in the installation. I have figured out the HDD bit.Comment
-
Hello
The below code used in MFC.
You must type below code:
__int64 Memstatus()
{
MEMORYSTATUS mem;
GetMemoryStatus (&mem);
return mem.dwAvailPhys ;
}
Other variables are :
DWORD dwLength;
DWORD dwMemoryLoad;
SIZE_T dwTotalPhys; //Total physical memory installed on computer
SIZE_T dwAvailPhys;
SIZE_T dwTotalPageFile ;
SIZE_T dwAvailPageFile ;
SIZE_T dwTotalVirtual; //total virtual memory
SIZE_T dwAvailVirtual;
Note: if Ram bigger than 4 GB MEMORYSTATUS may not response,thus you must use MEMORYSTATUSEX and GetMemoryStatus Ex.
Best regards,Comment
Comment