CbmRoot
Loading...
Searching...
No Matches
cbm::algo::MemoryLogger Class Reference

Track the memory usage of the process and write it to the log. More...

#include <MemoryLogger.h>

Public Member Functions

 MemoryLogger ()=default
 Constructor.
 
 ~MemoryLogger ()=default
 Destructor.
 
void Log ()
 Log the current memory usage.
 

Private Member Functions

template<typename T >
BytesToMB (T bytes) const
 

Private Attributes

size_t mLastRSS = 0
 

Detailed Description

Track the memory usage of the process and write it to the log.

Definition at line 20 of file MemoryLogger.h.

Constructor & Destructor Documentation

◆ MemoryLogger()

cbm::algo::MemoryLogger::MemoryLogger ( )
default

Constructor.

◆ ~MemoryLogger()

cbm::algo::MemoryLogger::~MemoryLogger ( )
default

Destructor.

Member Function Documentation

◆ BytesToMB()

template<typename T >
T MemoryLogger::BytesToMB ( T bytes) const
private

Definition at line 13 of file MemoryLogger.cxx.

Referenced by Log().

◆ Log()

void MemoryLogger::Log ( )

Log the current memory usage.

Definition at line 18 of file MemoryLogger.cxx.

References BytesToMB(), cbm::algo::GetCurrentRSS(), cbm::algo::GetPeakRSS(), L_, and mLastRSS.

Referenced by main().

Member Data Documentation

◆ mLastRSS

size_t cbm::algo::MemoryLogger::mLastRSS = 0
private

Definition at line 39 of file MemoryLogger.h.

Referenced by Log().


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