KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
List of all members
Kratos::MemoryInfo Class Reference

MemoryInfo gives the OS information about the memory usage by Kratos. More...

#include <memory_info.h>

Collaboration diagram for Kratos::MemoryInfo:

Public Member Functions

Type Definitions
 KRATOS_CLASS_POINTER_DEFINITION (MemoryInfo)
 Pointer definition of MemoryInfo. More...
 
Life Cycle
 MemoryInfo ()=default
 Default constructor. More...
 
virtual ~MemoryInfo ()=default
 Destructor. More...
 
Input and output
virtual std::string Info () const
 Turn back information as a string. More...
 
virtual void PrintInfo (std::ostream &rOStream) const
 Print information about this object. More...
 
virtual void PrintData (std::ostream &rOStream) const
 Print object's data. More...
 

Static Public Member Functions

Operations
static std::size_t GetPeakMemoryUsage ()
 
static std::size_t GetCurrentMemoryUsage ()
 
static std::string HumanReadableSize (std::size_t InBytes)
 

Detailed Description

MemoryInfo gives the OS information about the memory usage by Kratos.

This class provides the peak memory usage and current memory usage. The information is taken per OS and may vary in each execution depending on page allocation and other factors. The supported platforms are Windows, Linux and OSX.

Constructor & Destructor Documentation

◆ MemoryInfo()

Kratos::MemoryInfo::MemoryInfo ( )
default

Default constructor.

◆ ~MemoryInfo()

virtual Kratos::MemoryInfo::~MemoryInfo ( )
virtualdefault

Destructor.

Member Function Documentation

◆ GetCurrentMemoryUsage()

std::size_t Kratos::MemoryInfo::GetCurrentMemoryUsage ( )
static

This function returns the physical memory used currently by this process in bytes. It returns zero for not supported operating systems. The main idea is from: http://nadeausoftware.com/articles/2012/07/c_c_tip_how_get_process_resident_set_size_physical_memory_use rewritten for c++ and with style change

◆ GetPeakMemoryUsage()

std::size_t Kratos::MemoryInfo::GetPeakMemoryUsage ( )
static

This function returns the peak memory used by this process in bytes. It returns zero for not supported operating systems. The main idea is from: http://nadeausoftware.com/articles/2012/07/c_c_tip_how_get_process_resident_set_size_physical_memory_use rewritten/reordered to have independent code for each platform and some styling applied

◆ HumanReadableSize()

std::string Kratos::MemoryInfo::HumanReadableSize ( std::size_t  InBytes)
static

◆ Info()

virtual std::string Kratos::MemoryInfo::Info ( ) const
inlinevirtual

Turn back information as a string.

◆ KRATOS_CLASS_POINTER_DEFINITION()

Kratos::MemoryInfo::KRATOS_CLASS_POINTER_DEFINITION ( MemoryInfo  )

Pointer definition of MemoryInfo.

◆ PrintData()

virtual void Kratos::MemoryInfo::PrintData ( std::ostream &  rOStream) const
inlinevirtual

Print object's data.

◆ PrintInfo()

virtual void Kratos::MemoryInfo::PrintInfo ( std::ostream &  rOStream) const
inlinevirtual

Print information about this object.


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