Hello all... I'm trying to determine the amount of memory I need to specify as a minimum for running a program I'm working on... I've tried the following:
I do this at the start of my program, first thing, then after I load all my graphics and sound and whatnot, I do it again. It seems obvious that the difference is the amount of memory my program is taking up during execution (assuming no other memory allocations take place, which is the case).
However, I never seem to get the same result, and the range it varies is substantial. Also, the numbers don't seem to bear any relation to the amount of free memory as reported by various free memory reporting tools.
Am I missing something here? Is this the proper way to determine program memory usage? If not, how is that best accomplished?
Thanks all!
- Code:
MEMORYSTATUS ms;
ms.dwLength = sizeof(MEMORYSTATUS);
GlobalMemoryStatus(&ms;);
TCHAR szOut[22];
swprintf(szOut, L"%d", ms.dwAvailPhys);
wcscat(szOut, L"\n");
MessageBox(NULL, szOut, L"", MB_OK);
I do this at the start of my program, first thing, then after I load all my graphics and sound and whatnot, I do it again. It seems obvious that the difference is the amount of memory my program is taking up during execution (assuming no other memory allocations take place, which is the case).
However, I never seem to get the same result, and the range it varies is substantial. Also, the numbers don't seem to bear any relation to the amount of free memory as reported by various free memory reporting tools.
Am I missing something here? Is this the proper way to determine program memory usage? If not, how is that best accomplished?
Thanks all!