Go to the documentation of this file.
15 #include <mrpt/config.h>
20 #include <mach/mach_init.h>
21 #include <mach/task.h>
57 typedef BOOL(WINAPI* TGetProcessMemoryInfo)(
69 m_dll = LoadLibraryA(
"PSAPI.DLL");
72 m_ptr = (TGetProcessMemoryInfo)GetProcAddress(
73 m_dll,
"GetProcessMemoryInfo");
94 return (*m_ptr)(Process, ppsmemCounters, cb);
113 unsigned long MEM = 0;
120 pmc.
cb =
sizeof(pmc);
123 GetCurrentProcess(), &pmc,
sizeof(pmc)))
133 FILE* f =
::fopen(
"/proc/self/stat",
"r");
141 "%*d %*s %*c %*d %*d %*d %*d %*d %*u %*u %*u %*u %*u %*u %*u %*d "
142 "%*d %*d %*d %*d %*d %*u %lu",
153 mach_task_basic_info info;
154 mach_msg_type_number_t
count = MACH_TASK_BASIC_INFO_COUNT;
156 mach_task_self(), MACH_TASK_BASIC_INFO, (task_info_t)&info,
159 MEM = info.virtual_size;
unsigned long getMemoryUsage()
Returns the memory occupied by this process, in bytes.
int void fclose(FILE *f)
An OS-independent version of fclose.
SIZE_T QuotaPagedPoolUsage
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
SIZE_T QuotaPeakPagedPoolUsage
SIZE_T QuotaNonPagedPoolUsage
SIZE_T PeakWorkingSetSize
BOOL WINAPI GetProcessMemoryInfo(HANDLE Process, PPROCESS_MEMORY_COUNTERS ppsmemCounters, DWORD cb)
This is an auxiliary class for mrpt::system::getMemoryUsage() under Windows.
GLuint GLuint GLsizei count
TGetProcessMemoryInfo m_ptr
struct _PROCESS_MEMORY_COUNTERS PROCESS_MEMORY_COUNTERS
SIZE_T QuotaPeakNonPagedPoolUsage
struct _PROCESS_MEMORY_COUNTERS * PPROCESS_MEMORY_COUNTERS
FILE * fopen(const char *fileName, const char *mode) noexcept
An OS-independent version of fopen.
This namespace provides a OS-independent interface to many useful functions: filenames manipulation,...
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at mié 12 jul 2023 10:03:34 CEST | |