ITK  5.2.0
Insight Toolkit
Public Types | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
itk::MemoryProbe Class Reference

#include <itkMemoryProbe.h>

+ Inheritance diagram for itk::MemoryProbe:
+ Collaboration diagram for itk::MemoryProbe:

Public Types

using MeanMemoryLoadType = double
 
using MemoryLoadType = OffsetValueType
 
- Public Types inherited from itk::ResourceProbe< OffsetValueType, double >
using CountType = SizeValueType
 

Public Member Functions

 MemoryProbe ()
 
 ~MemoryProbe () override
 
- Public Member Functions inherited from itk::ResourceProbe< OffsetValueType, double >
virtual void ExpandedReport (std::ostream &os=std::cout, bool printSystemInfo=true, bool printReportHead=true, bool useTabs=false)
 
virtual OffsetValueType GetMaximum () const
 
virtual double GetMean () const
 
virtual OffsetValueType GetMinimum () const
 
virtual std::string GetNameOfProbe () const
 
CountType GetNumberOfIteration () const
 
CountType GetNumberOfStarts () const
 
CountType GetNumberOfStops () const
 
virtual OffsetValueType GetStandardDeviation ()
 
virtual OffsetValueType GetStandardError ()
 
virtual OffsetValueType GetTotal () const
 
std::string GetType () const
 
std::string GetUnit () const
 
virtual void JSONReport (std::ostream &os=std::cout)
 
virtual void PrintJSONSystemInformation (std::ostream &os=std::cout)
 
virtual void PrintSystemInformation (std::ostream &os=std::cout)
 
virtual void Report (std::ostream &os=std::cout, bool printSystemInfo=true, bool printReportHead=true, bool useTabs=false)
 
virtual void Reset ()
 
 ResourceProbe (std::string type, std::string unit)
 
virtual void SetNameOfProbe (const char *nameOfProbe)
 
virtual void Start ()
 
virtual void Stop ()
 
virtual ~ResourceProbe ()=default
 

Protected Member Functions

MemoryLoadType GetInstantValue () const override
 
- Protected Member Functions inherited from itk::ResourceProbe< OffsetValueType, double >
 itkLegacyMacro (virtual void GetSystemInformation())
 
virtual void PrintExpandedReportHead (std::ostream &os=std::cout, bool useTabs=false)
 
void PrintJSONvar (std::ostream &os, const char *varName, T varValue, unsigned indent=4, bool comma=true)
 
virtual void PrintReportHead (std::ostream &os=std::cout, bool useTabs=false)
 
virtual void UpdateMinimumMaximumMeasuredValue (OffsetValueType value)
 

Private Attributes

MemoryUsageObserver m_MemoryObserver
 

Detailed Description

Computes the memory allocated between two points in code.

This class allows the user to trace the memory charge between the execution of two pieces of code. It can be started and stopped in order to evaluate the execution over multiple passes. The values of memory are taken from GetProcessMemoryInfo() for Windows, the SMAPS file for Linux and getrusage() otherwise.

Examples
SphinxExamples/src/Core/Common/TraceMemoryBetweenPoints/Code.cxx.

Definition at line 39 of file itkMemoryProbe.h.

Member Typedef Documentation

◆ MeanMemoryLoadType

Type for measuring the average memory.

Definition at line 49 of file itkMemoryProbe.h.

◆ MemoryLoadType

Type for measuring memory.

Definition at line 46 of file itkMemoryProbe.h.

Constructor & Destructor Documentation

◆ MemoryProbe()

itk::MemoryProbe::MemoryProbe ( )

◆ ~MemoryProbe()

itk::MemoryProbe::~MemoryProbe ( )
override

Member Function Documentation

◆ GetInstantValue()

MemoryLoadType itk::MemoryProbe::GetInstantValue ( ) const
overrideprotectedvirtual

Returns the instant value of the probed system.

Implements itk::ResourceProbe< OffsetValueType, double >.

Member Data Documentation

◆ m_MemoryObserver

MemoryUsageObserver itk::MemoryProbe::m_MemoryObserver
mutableprivate

Definition at line 56 of file itkMemoryProbe.h.


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