memoryLoad Class Reference

#include <RobotAPI/libraries/armem_system_state/server/LightweightSystemMonitor/linux_memoryload.hpp>

Public Member Functions

uint64_t getCurrentMemUsageInKB ()
 get current Memory Usage of the system in KB More...
 
float getCurrentMemUsageInPercent ()
 get current memory usage of the system in percent 0-100% More...
 
uint64_t getMemoryUsageByThisProcess ()
 get memory usage of this process (self) More...
 
uint64_t getTotalMemoryInKB ()
 get total memory of the system in KB More...
 
 memoryLoad (std::string memInfo="/proc/meminfo", std::string memInfoOfProcess="/proc/self/status", std::string memInfoOfProcessPrefix="/proc/self/")
 

Static Public Member Functions

static uint64_t getMemoryUsedByProcess (int pid)
 get the current memory usage of a process More...
 

Detailed Description

Author
: Daniel Fuchs @contact: fuxey.nosp@m.solu.nosp@m.tions.nosp@m.@gma.nosp@m.il.co.nosp@m.m

distributed under the MIT License (MIT). Copyright (c) Daniel Fuchs

Definition at line 14 of file linux_memoryload.hpp.

Constructor & Destructor Documentation

◆ memoryLoad()

memoryLoad ( std::string  memInfo = "/proc/meminfo",
std::string  memInfoOfProcess = "/proc/self/status",
std::string  memInfoOfProcessPrefix = "/proc/self/" 
)
inlineexplicit

Definition at line 16 of file linux_memoryload.hpp.

Member Function Documentation

◆ getCurrentMemUsageInKB()

uint64_t getCurrentMemUsageInKB ( )

get current Memory Usage of the system in KB

Returns
used memory in KB

Definition at line 39 of file linux_memoryload.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCurrentMemUsageInPercent()

float getCurrentMemUsageInPercent ( )

get current memory usage of the system in percent 0-100%

Returns
0-100%

Definition at line 44 of file linux_memoryload.cpp.

+ Here is the call graph for this function:

◆ getMemoryUsageByThisProcess()

uint64_t getMemoryUsageByThisProcess ( )

get memory usage of this process (self)

Returns
memory usage in KB

Definition at line 50 of file linux_memoryload.cpp.

◆ getMemoryUsedByProcess()

uint64_t getMemoryUsedByProcess ( int  pid)
static

get the current memory usage of a process

Parameters
pid- process id
Returns
memory usage in KB

Definition at line 54 of file linux_memoryload.cpp.

+ Here is the call graph for this function:

◆ getTotalMemoryInKB()

uint64_t getTotalMemoryInKB ( )

get total memory of the system in KB

Returns
total memory in KB

Definition at line 34 of file linux_memoryload.cpp.

+ Here is the caller graph for this function:

The documentation for this class was generated from the following files: