From 27e8c96d3dd12a63ac095a2ac2dafa8d836fa7a9 Mon Sep 17 00:00:00 2001 From: hasherezade Date: Fri, 31 May 2024 17:46:07 -0700 Subject: [PATCH] [REFACT] Show log about used memory only when no cache available --- scanners/module_cache.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/scanners/module_cache.cpp b/scanners/module_cache.cpp index 533c3ffac..71cdc69f6 100644 --- a/scanners/module_cache.cpp +++ b/scanners/module_cache.cpp @@ -91,15 +91,18 @@ bool pesieve::ModulesCache::isCacheAvailable(const size_t neededSize) } #ifdef _DEBUG - std::cout << "C: " << std::hex << ppsmemCounter.WorkingSetSize - << "\tP: " << std::hex << ppsmemCounter.PeakWorkingSetSize - << "\tMin: " << minSize - << "\tMax: " << maxSize - << "\tGlobalMem Av Virt: " << std::hex << memStatus.ullAvailVirtual - << std::dec << "\tPerc: " << memStatus.dwMemoryLoad - << std::dec << " PercPeak: " << percPeak - << " HasFree: " << hasFree - << std::endl; + if (!hasFree) { + std::cout << "C: " << std::hex << ppsmemCounter.WorkingSetSize + << "\tP: " << std::hex << ppsmemCounter.PeakWorkingSetSize + << "\tMin: " << minSize + << "\tMax: " << maxSize + << "\tGlobalMem Av Virt: " << std::hex << memStatus.ullAvailVirtual + << std::dec << "\tPerc: " << memStatus.dwMemoryLoad + << std::dec << " PercPeak: " << percPeak + << " HasFree: " << hasFree + << " modulesCount: " << cachedModules.size() + << std::endl; + } #endif return hasFree; -} \ No newline at end of file +}