Removing commented code of different options for getting memory usage of a process
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
-34
@@ -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))) {
|
||||
|
||||
Reference in New Issue
Block a user