Removing commented code of different options for getting memory usage of a process

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
monroegm-disable-blank-issue-2
Esteban Papp 4 years ago
parent 3273b7621d
commit 160235e86f

@ -20,41 +20,7 @@ namespace Benchmark
{
EmptyWorkingSet(GetCurrentProcess());
//PROCESS_MEMORY_COUNTERS_EX pmc;
//GetProcessMemoryInfo(GetCurrentProcess(), (PPROCESS_MEMORY_COUNTERS)&pmc, sizeof(pmc));
//return pmc.PrivateUsage;
//return pmc.WorkingSetSize;
//size_t memoryUsage = 0;
//HANDLE defaultProcessHeap = GetProcessHeap();
//PROCESS_HEAP_ENTRY heapEntry;
//if (HeapLock(defaultProcessHeap) == FALSE)
//{
// AZ_Error("Benchmark", false, "Could not lock process' heap, error: %d", GetLastError());
// return memoryUsage;
//}
//heapEntry.lpData = NULL;
//while (HeapWalk(defaultProcessHeap, &heapEntry) != FALSE)
//{
// memoryUsage += heapEntry.cbData;
//}
//DWORD lastError = GetLastError();
//if (lastError != ERROR_NO_MORE_ITEMS)
//{
// AZ_Error("Benchmark", false, "HeapWalk failed with LastError %d", lastError);
//}
//if (HeapUnlock(defaultProcessHeap) == FALSE)
//{
// AZ_Error("Benchmark", false, "Failed to unlock heap with LastError %d", GetLastError());
//}
//return memoryUsage;
size_t memoryUsage = 0;
MEMORY_BASIC_INFORMATION mbi = { 0 };
unsigned char* pEndRegion = NULL;
while (sizeof(mbi) == VirtualQuery(pEndRegion, &mbi, sizeof(mbi))) {

Loading…
Cancel
Save