7 #ifndef __FWMEMORY_TOOLS_POSIXMEMORYMONITORTOOLS_HPP__ 8 #define __FWMEMORY_TOOLS_POSIXMEMORYMONITORTOOLS_HPP__ 10 #if defined(linux) || defined(__linux) 12 #include "fwMemory/config.hpp" 28 std::uint64_t buffered;
30 std::uint64_t swapcached;
31 std::uint64_t swaptotal;
32 std::uint64_t swapfree;
80 class FWMEMORY_CLASS_API PosixMemoryMonitorTools
85 FWMEMORY_API PosixMemoryMonitorTools();
87 FWMEMORY_API ~PosixMemoryMonitorTools();
89 FWMEMORY_API
static std::uint64_t estimateFreeMem();
91 FWMEMORY_API
static void printProcessMemoryInformation();
93 FWMEMORY_API
static void printSystemMemoryInformation();
95 FWMEMORY_API
static void printMemoryInformation();
97 FWMEMORY_API
static std::uint64_t getTotalSystemMemory();
99 FWMEMORY_API
static std::uint64_t getUsedSystemMemory();
101 FWMEMORY_API
static std::uint64_t getFreeSystemMemory();
103 FWMEMORY_API
static std::uint64_t getUsedProcessMemory();
107 static std::uint64_t s_pageSize;
108 static std::uint64_t s_totalMemory;
111 static std::uint64_t extract_number(
char* str,
int start,
int end );
114 static void get_memory_stats( MemInfo& meminfo );
116 static void printStatus( Status& stat );
118 static void analyseMemInfo( std::string& line, MemInfo& meminfo );
120 static void analyseStatusLine( std::string& line, Status& stat );
122 static void getStatusOfPid(
int pid, Status& stat);
124 static void getAllStatus(Status& allStat);
126 static void printAllStatus();
132 #endif //defined(linux) || defined(__linux) 134 #endif // __FWMEMORY_TOOLS_POSIXMEMORYMONITORTOOLS_HPP__ The namespace fwMemory contains tools to manage memory. Use for dump.