Please point me to the easiest way to find out how much RAM current process is used.
Platform: Windows 10 Language: С++ Library: Win API
With win API GetProcessMemoryInfo you can obtain a process memory information,for example:
#include <windows.h>
#include <psapi.h>
#include <iostream>
int main(int argc, const char** argv)
{
::PROCESS_MEMORY_COUNTERS pmc;
if ( ::GetProcessMemoryInfo( ::GetCurrentProcess(), &pmc, sizeof(pmc)) ) {
std::cout << "Current process working set size " << (pmc.WorkingSetSize / 1024) << " KiB" << std::endl;
std::cout << "Current process peak working set size " << (pmc.PeakWorkingSetSize / 1024) << " KiB" << std::endl;
}
return 0;
}
As well as you can profile your app without adding any additional code profiling with Visual Studio
And with Process Explorer you can obtains any system process detailed information.