26 #include <sys/resource.h>
40 long int memoryUsage = -1;
43 HANDLE hProc = GetCurrentProcess();
44 PROCESS_MEMORY_COUNTERS
info;
45 BOOL okay = GetProcessMemoryInfo(hProc, &
info,
sizeof(
info));
48 memoryUsage =
info.WorkingSetSize;
52 if(getrusage(RUSAGE_SELF, &u) == 0)
54 memoryUsage = u.ru_maxrss;
57 std::fstream
file(
"/proc/self/status", std::fstream::in);